Scanner scan = new Scanner(System.in) def s = {scan.nextLine()} def a = s() " " print "def $a(x):\n return x+${(a=~/\d+/)[0]}"