#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
long long n, x, y, nr;
long long cx, cy;
int ans[2000002];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> x >> y;
  int xx = 0;
  while (xx <= x + y) {
    long long pa = (cx + 1) * y;
    long long pb = (cy + 1) * x;
    if (pa == pb)
      ++cx, ++cy, xx += 2;
    else if (pa < pb)
      ans[xx] = 1, ++cx, ++xx;
    else
      ans[xx] = 2, ++cy, ++xx;
  }
  for (int i = 1; i <= n; ++i) {
    cin >> nr;
    --nr;
    nr %= (x + y);
    if (ans[nr] == 1) cout << "Vanya" << '\n';
    if (ans[nr] == 2) cout << "Vova" << '\n';
    if (ans[nr] == 0) cout << "Both" << '\n';
  }
  return 0;
}
