#include <bits/stdc++.h>
#define endl "\n"
typedef long long ll;
using namespace std;
const int N = 2e5 + 7;
vector<vector<int>> g(N);
int table[N + 1][22];
int level[N], tin[N], tout[N];
int n, lg, Time = 0, INF = 1e9 + 7;
void dfs(int v, int par = -1, int dep = 0) {
table[v][0] = par;
level[v] = dep;
tin[v] = ++Time;
for (int i = 1; i <= lg; i++) {
if (table[v][i - 1] != -1) {
table[v][i] = table[table[v][i - 1]][i - 1];
}
}
for (auto &child : g[v]) {
if (child == par) continue;
dfs(child, v, dep + 1);
}
tout[v] = ++Time;
}
void lca_build(int root = 1) { //=> O(n*logn)
dfs(root);
}
int lca_query(int a, int b) { //=> O(logn)
if (level[a] < level[b]) swap(a, b);
for (int i = lg; i >= 0; i--) { //a and b come to the same level
if (table[a][i] != -1 && level[table[a][i]] >= level[b])
a = table[a][i];
}
if (a == b) return a;
for (int i = lg; i >= 0; i--) {
if (table[a][i] != -1 && table[a][i] != table[b][i])
a = table[a][i], b = table[b][i];
}
return table[a][0];
}
int dist(int u, int v) { // distance between two node
int l = lca_query(u, v);
return level[u] + level[v] - (level[l] << 1); //level[l]*2
}
int kth(int u, int k) {
for (int i = 0; i <= lg; i++)
if (k & (1 << i)) u = table[u][i];
return u;
}
int findKth(int u, int v, int k) { // kth node from u to v, 0th node is u
int l = lca_query(u, v);
int d = level[u] + level[v] - (level[l] << 1);
if (level[l] + k <= level[u]) return kth(u, k);
k -= level[u] - level[l];
return kth(v, level[v] - level[l] - k);
}
void reset() {
lg = log2(n) + 1;
for (int i = 0; i <= n; i++) {
g[i].clear();
level[i] = 0;
for (int j = 0; j <= lg; j++) table[i][j] = -1;
}
}
int main() {
cin >> n;
reset();
vector<int> C(n + 1, 0);
int tot = 0;
for(int i = 1; i <= n; i++) cin >> C[i], tot += 2 * C[i];
for (int i = 0; i < n - 1; i++) {
int u, v;
cin >> u >> v;
g[u].push_back(v);
g[v].push_back(u);
}
for(int i = 1; i <= n; i++) {
if(g[i].size() == 1) {
lca_build(i);
break;
}
}
vector<int> arr(Time + 1, 0);
for(int i = 1; i <= n; i++) {
arr[tin[i]] = C[i];
arr[tout[i]] = C[i];
}
vector<int> pre(Time + 1, 0);
for(int i = 1; i <= Time; i++) {
pre[i] = pre[i - 1] + arr[i];
}
auto Sum = [&](int l, int r) -> int {
return pre[r] - pre[l - 1];
};
// Querys
int q;
cin >> q;
while (q--) {
int u, v;
cin >> u >> v;
if(u == v) {
cout << "weee" << endl;
continue;
}
int uMx, vMx;
int d = dist(u, v);
if(d == 1) {
uMx = u, vMx = v;
}
else {
uMx = findKth(u, v, (d - 1) >> 1);
vMx = findKth(uMx, v, 1);
}
if(tin[vMx] <= tin[uMx] && tout[vMx] >= tout[uMx]) {
if(Sum(tin[uMx], tout[uMx]) == 0) cout << "weee" << endl;
else cout << "oops" << endl;
}
else {
if(tot - Sum(tin[vMx], tout[vMx]) == 0) cout << "weee" << endl;
else cout << "oops" << endl;
}
}
return 0;
}