#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  long long int x, y;
  cin >> n >> x >> y;
  long long int h1 = 1, h2 = 1;
  vector<int> a(x + y + 1);
  for (int i = 1; i <= (int)(x + y); ++i) {
    if (h1 * y == h2 * x) {
      a[i] = a[i + 1] = 3;
      i++;
      h1++;
      h2++;
    } else if (h1 * y > h2 * x) {
      a[i] = 2;
      h2++;
    } else {
      a[i] = 1;
      h1++;
    }
  }
  while (n--) {
    int ai;
    cin >> ai;
    ai = (ai - 1) % (x + y);
    if (a[ai + 1] == 1) {
      cout << "Vanya\n";
    } else if (a[ai + 1] == 2) {
      cout << "Vova\n";
    } else {
      cout << "Both\n";
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
