#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n), b(n); // 存储小A和小B的出拳
int winA = 0, winB = 0; // 统计小A和小B赢的轮数
// 读入每一轮出拳
for (int i = 0; i < n; ++i) {
cin >> a[i] >> b[i];
}
// 统计胜负
for (int i = 0; i < n; ++i) {
if ((a[i] == 1 && b[i] == 2) || (a[i] == 2 && b[i] == 3) || (a[i] == 3 && b[i] == 1)) {
winA++;
} else if ((b[i] == 1 && a[i] == 2) || (b[i] == 2 && a[i] == 3) || (b[i] == 3 && a[i] == 1)) {
winB++;
}
}
// 输出结果
if (winA > winB) {
cout << "a win" << endl;
} else if (winB > winA) {
cout << "b win" << endl;
} else {
cout << "draw" << endl;
}
return 0;
}
/**************************************************************
Problem: 1406
User: zhenghaoxuan
Language: C++
Result: Wrong Answer
****************************************************************/