#include <bits/stdc++.h>
using namespace std;
long long n, x, y;
long long que;
void solve() {
  que %= (x + y);
  if (que == 0) {
    cout << "Both" << endl;
  } else {
    long long l = -1, r = que + 1;
    while (r - l > 1) {
      long long mid = (l + r) / 2;
      long long beat = mid + mid * y / x;
      if ((mid * y) % x == 0) {
        if (beat == que || beat == que + 1) {
          cout << "Both" << endl;
          return;
        }
      }
      if (beat > que)
        r = mid;
      else if (beat < que)
        l = mid;
      else {
        cout << "Vanya" << endl;
        return;
      }
    }
    l = -1, r = que + 1;
    while (r - l > 1) {
      long long mid = (l + r) / 2;
      long long beat = mid + mid * x / y;
      if ((mid * x) % y == 0) {
        if (beat == que || beat == que + 1) {
          cout << "Both" << endl;
          return;
        }
      }
      if (beat > que)
        r = mid;
      else if (beat < que)
        l = mid;
      else {
        cout << "Vova" << endl;
        return;
      }
    }
  }
}
int main() {
  while (scanf("%I64d%I64d%I64d", &n, &x, &y) != EOF) {
    for (int i = 0; i < n; i++) {
      scanf("%I64d", &que);
      solve();
    }
  }
  return 0;
}
