#53431: pythoon


11331061@stu.tshs.tp.edu.tw (一仁21王冠鈞)

學校 : 不指定學校
編號 : 281855
來源 : [125.228.248.38]
最後登入時間 :
2025-10-03 14:02:30

f=input()

k=f
n=int(input())
nx=input().split()

roun=0
for i in range(n):
    if i >=1:
        k+=" %s" % f
            
        
    if (f =="5" and nx[i]=="0") or (f=="0" and nx[i]=="2") or (f=="2" and nx[i]=="5"):
        print(k,":","Won at round",i+1)
        break
    elif f==nx[i]:
        roun+=1
    else:
        print(k,":","Lost at round",i+1)
        break
    if roun ==2:
        roun=0
        if nx[i]=="5":
            f="2"
        elif nx[i]=="0":
            f="5"
        else:
            f="0"
    if i+1==n:
        print(k,":","Drew at round",i+1)