Scanner s=new Scanner(System.in) def x=s.nextLine() def n=s.nextInt() x=x.replaceAll(/\d+/,{it->it.toInteger()*n}) println x