#include <bits/stdc++.h>
using namespace std;
long long n, x, y;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long cal(long long n) { return n / x + n / y; }
int main() {
  cin >> n >> x >> y;
  for (int i = 1; i <= n; ++i) {
    long long q;
    cin >> q;
    long long l = 0, r = max(x * q, y * q);
    while (l < r - 1) {
      long long mid = (l + r) >> 1;
      if (cal(mid) >= q)
        r = mid;
      else
        l = mid;
    }
    if (r % x == 0 && r % y == 0)
      cout << "Both" << endl;
    else if (r % x == 0)
      cout << "Vova" << endl;
    else
      cout << "Vanya" << endl;
  }
  return 0;
}
