s = '' tmp = 0 puts '0000000000' x,judge = gets.chomp.split x = x.to_i if judge == 'unlocked' exit end if tmp < x tmp = x s = '0' end 10.times{ 1.upto(9){|i| puts "%010d" % (i.to_s + s) STDOUT.flush x,judge = gets.chomp.split x = x.to_i if judge == 'unlocked' exit end if tmp < x tmp = x s = i.to_s + s break end } s = '0' + s }