a=int(input())
b=int(input())
c=[int(x) for x in input().split()]
f=0
g=0
k=1
for i in range(0,1):
if (c[0]==2 and a==0) or (c[0]==5 and a==2) or (c[0]==0 and a==5):
print(a,end=" ")
f=1
break
if (c[0]==0 and a==2) or (c[0]==2 and a==5) or (c[0]==5 and a==0):
print(a,end=" ")
g=1
break
if (c[0]==0 and a==0) or (c[0]==2 and a==2) or (c[0]==5 and a==5):
print(a,end=" ")
k=k+1
for i in range(1,len(c)):
if (c[i]==2 and a==0) or (c[i]==5 and a==2) or (c[i]==0 and a==5):
print(a,end=" ")
f=1
break
if (c[i]==0 and a==2) or (c[i]==2 and a==5) or (c[i]==5 and a==0):
print(a,end=" ")
g=1
break
if (c[i]==0 and a==0) or (c[i]==2 and a==2) or (c[i]==5 and a==5):
print(c[i],end=" ")
if (c[i]==c[i-1]==0):
a=5
if (c[i]==c[i-1]==2):
a=0
if (c[i]==c[i-1]==5):
a=2
if (c[i]!=c[i-1]):
a=c[i]
k=k+1
if f==1:
print(": Won at round "+str(k))
if g==1:
print(": Lost at round "+str(k))
if f!=1 and g!=1:
print(": Drew at round "+str(len(c)))