#include <bits/stdc++.h>
using namespace std;
const long long oo = 1e18 + 5;
long long n, a, b, l;
long long cnt(long long x) { return x / a + x / b; }
void solve() {
  cin >> n >> a >> b;
  swap(a, b);
  while (n--) {
    long long x;
    cin >> x;
    long long l = 0, r = 1e18, ans = -1;
    while (r >= l) {
      long long m = l + r >> 1;
      if (cnt(m) >= x) {
        ans = m;
        r = m - 1;
      } else {
        l = m + 1;
      }
    }
    if (ans % a == 0 && ans % b == 0) {
      cout << "Both\n";
    } else if (ans % a == 0) {
      cout << "Vanya\n";
    } else {
      cout << "Vova\n";
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  while (T--) {
    solve();
  }
}
