#include <bits/stdc++.h>
using namespace std;
const int MM = 100005;
const long long MOD = 1000000007;
long long n, x, y, lcm;
long long gcd(long long u, long long v) {
  if (v == 0) return u;
  return gcd(v, u % v);
}
long long calc(long long u) { return u / x + u / y; }
int main() {
  cin >> n >> x >> y;
  lcm = x * y / gcd(x, y);
  for (int i = 0; i < n; i++) {
    long long ans = (1LL << 62);
    long long u, l = 0, r = (1LL << 62);
    scanf("%I64d", &u);
    while (r >= l) {
      long long mid = l + (r - l) / 2;
      long long res = calc(mid);
      if (res >= u) {
        ans = min(mid, ans);
        r = mid - 1;
      } else
        l = mid + 1;
    }
    long long xx = ans / x, yy = ans / y;
    if (ans % lcm == 0)
      puts("Both");
    else if (ans % y == 0)
      puts("Vanya");
    else
      puts("Vova");
  }
  return 0;
}
