#include <bits/stdc++.h>
using namespace std;
int xx[4] = {0, 0, 1, -1};
int yy[4] = {1, -1, 0, 0};
int n, k, x, y;
long long calc_x(long long t) {
  long long k = (t * y) / x + t;
  return k;
}
long long calc_y(long long t) {
  long long k = (t * x) / y + t;
  return k;
}
void solve(int k) {
  int l = 1, r = int(1e9 + 7), res_x, res_y;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (calc_x(mid) >= k) {
      r = mid - 1;
      res_x = mid;
    } else
      l = mid + 1;
  }
  l = 1, r = int(1e9 + 7);
  while (l <= r) {
    int mid = (l + r) / 2;
    if (calc_y(mid) >= k) {
      r = mid - 1;
      res_y = mid;
    } else
      l = mid + 1;
  }
  if (calc_x(res_x) == k && calc_y(res_y) == k) {
    cout << "Both" << endl;
  } else if (calc_x(res_x) == k) {
    cout << "Vanya" << endl;
  } else if (calc_y(res_y) == k) {
    cout << "Vova" << endl;
  } else
    cout << "Both" << endl;
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  for (int i = (1), _b = (n); i <= _b; i++) {
    scanf("%d", &k);
    solve(k);
  }
}
