#include <bits/stdc++.h>
using namespace std;
int h[3000000];
int main() {
  long long n, x, y, a, b, t, i;
  cin >> n >> x >> y;
  a = 1;
  b = 1;
  while (a <= x || b <= y)
    if (a * y < b * x) {
      h[a + b - 1] = 1;
      a++;
    } else if (a * y > b * x) {
      h[a + b - 1] = 0;
      b++;
    } else {
      h[a + b - 1] = 2;
      h[a + b] = 2;
      a++;
      b++;
    }
  for (i = 0; i < n; i++) {
    cin >> t;
    t--;
    t %= x + y;
    t++;
    switch (h[t]) {
      case 1:
        cout << "Vanya" << endl;
        break;
      case 0:
        cout << "Vova" << endl;
        break;
      case 2:
        cout << "Both" << endl;
        break;
    }
  }
  return 0;
}
