rt
#include <bits/stdc++.h>
using namespace std;
int book[3][3],tmp,x,y;
bool check1(){return (book[0][0]==1&&book[1][0]==1&&book[2][0]==1)||(book[0][1]==1&&book[1][1]==1&&book[2][1]==1)||(book[0][2]==1&&book[1][2]==1&&book[2][2]==1)||(book[0][0]==1&&book[0][1]==1&&book[0][2]==1)||(book[1][0]==1&&book[1][1]==1&&book[1][2]==1)||(book[2][0]==1&&book[2][1]==1&&book[2][2]==1)||(book[0][0]==1&&book[1][1]==1&&book[2][2]==1)||(book[0][2]==1&&book[1][1]==1&&book[2][0]==1);}
bool check2(){return (book[0][0]==2&&book[1][0]==2&&book[2][0]==2)||(book[0][1]==2&&book[1][1]==2&&book[2][1]==2)||(book[0][2]==2&&book[1][2]==2&&book[2][2]==2)||(book[0][0]==2&&book[0][1]==2&&book[0][2]==2)||(book[1][0]==2&&book[1][1]==2&&book[1][2]==2)||(book[2][0]==2&&book[2][1]==2&&book[2][2]==2)||(book[0][0]==2&&book[1][1]==2&&book[2][2]==2)||(book[0][2]==2&&book[1][1]==2&&book[2][0]==2);}
string s;
int main(){
cin>>s;
if(s.size()<9){puts(s.size()%2?"xiaoa wins.":"uim wins.");return 0;}
for(int i=0;i<s.length();i++){
tmp=s[i]-'0';
x=tmp%3?tmp/3:tmp/3-1;
y=tmp%3?tmp%3-1:2;
book[x][y]=i%2+1;
}
if(check1())cout<<"xiaoa wins."<<endl;
else if(check2())cout<<"uim wins."<<endl;
else cout<<"draw."<<endl;
return 0;
}