#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, y;
  cin >> n >> x >> y;
  for (long long i = 0; i < n; i++) {
    long long t;
    cin >> t;
    t = t % (x + y);
    if (x == y || t == x + y - 1 || t == 0) {
      cout << "Both\n";
      continue;
    }
    long long tam = t, l = 0, r = x, mid;
    while (l < r) {
      mid = l - (l - r) / 2;
      if ((mid + (mid * y) / x == tam || mid + (mid * y) / x == tam + 1) &&
          (mid * y) % x == 0) {
        cout << "Both\n";
        break;
      }
      if (mid + (mid * y) / x == tam) {
        cout << "Vanya\n";
        break;
      }
      if (mid + (mid * y) / x < tam)
        l = mid + 1;
      else
        r = mid;
    }
    if (l >= r) cout << "Vova\n";
  }
}
