#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  long long n, a, b, t, x;
  cin >> n >> a >> b;
  if (gcd(a, b) == 1)
    t = a + b - 1;
  else
    t = (a + b) / gcd(a, b) - 1;
  std::vector<string> v(t + 1);
  long double aa = 1, bb = 1;
  for (int i = 0; i < t - 1; i++) {
    long double q = aa / a, w = bb / b;
    if (q < w) {
      v[i] = "Vanya";
      aa += 1;
    }
    if (q > w) {
      v[i] = "Vova";
      bb += 1;
    }
  }
  v[t - 1] = "Both";
  v[t] = "Both";
  t++;
  for (int i = 0; i < n; i++) {
    cin >> x;
    x -= 1;
    x %= t;
    cout << v[x] << endl;
  }
}
