#include <bits/stdc++.h>
using namespace std;
long long n, x, y;
long long a[110000];
int main() {
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    a[i] %= (x + y);
    if (a[i] == 0) {
      cout << "Both" << endl;
    } else {
      long long g = ((x * a[i]) % (x + y));
      long long h = ((y * a[i]) % (x + y));
      if (g == 0 && h == 0) {
        cout << "Both" << endl;
      } else {
        g = y - g;
        h = x - h;
        if (g > h) {
          cout << "Vova" << endl;
        } else if (g < h) {
          cout << "Vanya" << endl;
        } else {
          cout << "Both" << endl;
        }
      }
    }
  }
  return 0;
}
