#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const int N = 1e6 + 10;
const long long mod = 1e9 + 7;
const int base = 131;
const double pi = acos(-1);
const double eps = 1e-8;
long long vis[N], num[N], n, m, k, x, y, z;
long long a[N], b[N];
long long ex, ey, cnt, ans, sum, flag, t, ff;
map<pair<int, int>, int> mp;
set<int> sa, sb;
vector<pair<int, int> > p;
bool check(int ci) {
  long long ty = (ci * y) / x;
  if (ci + ty >= k)
    return 1;
  else
    return 0;
}
bool check2(int ci) {
  long long tx = (ci * x) / y;
  if (ci + tx >= k)
    return 1;
  else
    return 0;
}
void solve(long double x, long double y) {
  if (x == y)
    cout << "Both" << endl;
  else if (x > y)
    cout << "Vova" << endl;
  else
    cout << "Vanya" << endl;
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  if (x > y)
    t = x;
  else
    t = y;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &k);
    int l = 1, r = 1e9;
    while (l <= r) {
      int mid = l + r >> 1;
      if (check(mid)) {
        ans = mid;
        r = mid - 1;
      } else
        l = mid + 1;
    }
    long double ex = (ans * 1.0) / x;
    l = 1;
    r = 1e9;
    while (l <= r) {
      int mid = l + r >> 1;
      if (check2(mid)) {
        ans = mid;
        r = mid - 1;
      } else
        l = mid + 1;
    }
    long double ey = (ans * 1.0) / y;
    solve(ex, ey);
  }
}
