def f(a,b): #判斷輸贏
if a == 0:
if b == 0:
return 'tie'
elif b == 2:
return 'win'
elif b == 5:
return 'lose'
elif a == 2:
if b == 0:
return 'lose'
elif b == 2:
return 'tie'
elif b == 5:
return 'win'
elif a == 5:
if b == 0:
return 'win'
elif b == 2:
return 'lose'
elif b == 5:
return 'tie'
F = int(input())
N = int(input())
Y = list(map(int,input().split()))
sav = []
for i in range(N):
sav.append(F)
result = f(F,Y[i])
if result == 'tie':
if i == N-1: #在最後一輪平手
print(*sav,end = '')
print(f' : Drew at round {i+1}')
break
else:
if i == 0: #第一輪平手,避免out of range
F = Y[i] #哥哥出妹妹上一輪的拳
else:
if Y[i-1] == Y[i]: #妹妹連續兩次出一樣的拳
if Y[i] == 0:
F = 5
elif Y[i] == 2:
F = 0
elif Y[i] == 5:
F = 2
else:
F = Y[i]
continue
elif result == 'win':
print(*sav,end = '')
print(f' : Won at round {i+1}')
break
elif result == 'lose':
print(*sav,end = '')
print(f' : Lost at round {i+1}')
break