#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("avx,tune=native")
using namespace std;
template <typename T>
using pq_gt = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using pq_lt = priority_queue<T, vector<T>, less<T>>;
long long int n, x, y, a;
int check(int p) {
  int b = p * y / x;
  if (p + b < a) {
    return 3;
  } else if (p + b > a + 1) {
    return 4;
  }
  if ((p * y) % x == 0) {
    return 0;
  }
  if (p + b == a) {
    return 1;
  } else {
    return 2;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> x >> y;
  string str1 = "Vanya", str2 = "Vova";
  if (x < y) {
    swap(x, y);
    swap(str1, str2);
  }
  for (int i = 0; i < n; ++i) {
    cin >> a;
    int lo = 0, hi = a;
    while (true) {
      int mid = (lo + hi) / 2;
      int k = check(mid);
      if (k == 0) {
        cout << "Both\n";
        break;
      } else if (k == 1) {
        cout << str1 << "\n";
        break;
      } else if (k == 2 && lo == hi) {
        cout << str2 << "\n";
        break;
      } else if (k == 3) {
        lo = mid + 1;
      } else {
        hi = mid;
      }
    }
  }
}
