#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, X, Y;
  cin >> N >> X >> Y;
  vector<const char *> R(X + Y);
  int i = 0;
  int xi = 1;
  int yi = 1;
  while (i < X + Y) {
    long long d = Y * xi - X * yi;
    if (d < 0) {
      R[i] = "Vanya";
      xi++;
    } else if (d > 0) {
      R[i] = "Vova";
      yi++;
    } else {
      R[i] = "Both";
      i++;
      R[i] = "Both";
      xi++;
      yi++;
    }
    i++;
  }
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    int ost = (a - 1) % (X + Y);
    cout << R[ost] << '\n';
  }
  return 0;
}
