lst = list(input())
length = len(lst)
alist = []
uimlist = []
for i in range(0, length, 2):
alist.append(int(lst[i]))
for i in range(1, length, 2):
uimlist.append(int(lst[i]))
awin = 0
if alist.count(5):
if alist.count(1) and alist.count(9):
awin = 1
elif alist.count(2) and alist.count(8):
awin = 1
elif alist.count(3) and alist.count(7):
awin = 1
elif alist.count(4) and alist.count(6):
awin = 1
if alist.count(2):
if alist.count(1) and alist.count(3):
awin = 1
if alist.count(4):
if alist.count(1) and alist.count(7):
awin = 1
if alist.count(6):
if alist.count(3) and alist.count(9):
awin = 1
if alist.count(8):
if alist.count(7) and alist.count(9):
awin = 1
uimwin = 0
if uimlist.count(5):
if uimlist.count(1) and uimlist.count(9):
uimwin = 1
elif uimlist.count(2) and uimlist.count(8):
uimwin = 1
elif uimlist.count(3) and uimlist.count(7):
uimwin = 1
elif uimlist.count(4) and uimlist.count(6):
uimwin = 1
if uimlist.count(2):
if uimlist.count(1) and uimlist.count(3):
uimwin = 1
if uimlist.count(4):
if uimlist.count(1) and uimlist.count(7):
uimwin = 1
if uimlist.count(6):
if uimlist.count(3) and uimlist.count(9):
uimwin = 1
if uimlist.count(8):
if uimlist.count(7) and uimlist.count(9):
uimwin = 1
if awin == 1:
print("xiaoa wins.")
elif uimwin == 1:
print("uim wins.")
else:
print("drew.")