class Calc0008 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @p = args.shift.first.to_i @nks = args.map { |l| l.map(&:to_i) } end def calc @nks.map { |n, k| n % (k + 1) != 1 } end def run calc.map { |r| r ? 'Win' : 'Lose' } end end puts Calc0008.new(STDIN.readlines).run if __FILE__ == $0