26 lines
441 B
Python
26 lines
441 B
Python
from __future__ import print_function
|
|
import sys
|
|
|
|
n, m = sys.stdin.readline().split()
|
|
n, m = int(n), int(m)
|
|
n, m = max(n, m), min(n, m)
|
|
|
|
l = []
|
|
l.append((n, m))
|
|
while m != 0:
|
|
n, m = m, n % m
|
|
l.append((n, m))
|
|
l.reverse()
|
|
|
|
wins = [False]
|
|
|
|
for i in range(len(l) - 1):
|
|
if not wins[i]:
|
|
wins.append(True)
|
|
elif l[i + 1][0] == l[i][0] + l[i][1]:
|
|
wins.append(False)
|
|
else:
|
|
wins.append(True)
|
|
|
|
print("win" if wins[-1] else "lose")
|