#include <iostream>
#include <algorithm>
using namespace std;
int equality(int a, int b){
return a == b ? a : 0;
}
void build(int *a, int *tr, int v, int l, int r) {
if (l == r) {
tr[v] = a[l];
} else {
int middle = (l + r) / 2;
build(a, tr, 2 * v, l, middle);
build(a, tr, 2 * v + 1, middle + 1, r);
tr[v] = equality(tr[2 * v], tr[2 * v + 1]);
}
}
void update(int *tr, int v, int l, int r, int pos, int val) {
if (l == r) {
tr[v] = val;
} else {
int middle = (l + r) / 2;
if (pos <= middle) {
update(tr, 2 * v, l, middle, pos, val);
} else {
update(tr, 2 * v + 1, middle + 1, r, pos, val);
}
tr[v] = equality(tr[2 * v], tr[2 * v + 1]);
}
}
int getEquality(int *tr, int v, int l, int r, int left, int right) {
if (l == left && r == right) {
return tr[v];
}
int middle = (l + r) / 2;
if (right <= middle) {
return getEquality(tr, 2 * v, l, middle, left, right);
}
else if (left >= middle + 1) {
return getEquality(tr, 2 * v + 1, middle + 1, r, left, right);
}
else {
return equality(getEquality(tr, 2 * v, l, middle, left, middle),
getEquality(tr, 2 * v + 1, middle + 1, r, middle + 1, right));
}
}
int main() {
int n;
cin >> n;
int *a = new int[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int *tr = new int[4 * n];
build(a, tr, 1, 0, n - 1);
int m;
cin >> m;
for (int i = 0; i < m; i++) {
int q, l, r;
cin >> q >> l >> r;
if (q == 1) {
cout << (getEquality(tr, 1, 0, n - 1, l - 1, r - 1) != 0 ? "draw" : "wins") << endl;
} else if (q == 2) {
update(tr, 1, 0, n - 1, l - 1, r);
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBlcXVhbGl0eShpbnQgYSwgaW50IGIpewoJcmV0dXJuIGEgPT0gYiA/IGEgOiAwOwp9CiAKdm9pZCBidWlsZChpbnQgKmEsIGludCAqdHIsIGludCB2LCBpbnQgbCwgaW50IHIpIHsK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