#include <bits/stdc++.h>
using namespace std;
int n;
long long x, y;
long long cntx, cnty;
vector<int> vec;
long long mod(long long q) { return max(q, -q); }
int main() {
  cin >> n >> x >> y;
  while (cntx < x || cnty < y) {
    if ((cntx + 1) * y == (cnty + 1) * x) {
      vec.push_back(0);
      vec.push_back(0);
      cntx++;
      cnty++;
      continue;
    }
    if ((cntx + 1) * y < (cnty + 1) * x) {
      vec.push_back(1);
      cntx++;
    } else {
      vec.push_back(2);
      cnty++;
    }
  }
  for (int i = 0; i < n; i++) {
    long long cnt;
    cin >> cnt;
    cnt--;
    if (vec[cnt % (vec.size())] == 0)
      cout << "Both" << endl;
    else if (vec[cnt % (vec.size())] == 1)
      cout << "Vanya" << endl;
    else
      cout << "Vova" << endl;
  }
}
