#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N |= (1LL << pos); }
int Reset(int N, int pos) { return N &= ~(1LL << pos); }
bool Check(int N, int pos) { return N & (1LL << pos); }
int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1};
inline void cn(long &n) {
  n = 0;
  long ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  n = n * sign;
}
template <class T>
void cmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
void cmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
int len(const T &c) {
  return (int)c.size();
}
template <class T>
int len(char c[]) {
  return (int)strlen(c);
}
string itos(long n) {
  string s;
  while (n) {
    s += (n % 10 + 48);
    n /= 10;
  }
  reverse(s.begin(), s.end());
  return s;
}
long stoi(string s) {
  long n = 0;
  for (int i(0), _n(len(s)); i < _n; ++i) n = n * 10 + (s[i] - 48);
  return n;
}
long long n, a, b, i, j, k, res[20000006];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> a >> b;
  for (i = 1, j = 1, k = 1; i <= a || j <= b; k++) {
    if (i * b < j * a) {
      res[k] = 1;
      i++;
    } else if (i * b > j * a) {
      res[k] = 2;
      j++;
    } else {
      res[k] = 3;
      res[k++] = 3;
      i++;
      j++;
    }
  }
  k--;
  for (int i(0), _n(n); i < _n; ++i) {
    cin >> a;
    if (a % k == 0)
      b = res[k];
    else
      b = res[a % k];
    if (b == 1)
      cout << "Vanya\n";
    else if (b == 2)
      cout << "Vova\n";
    else
      cout << "Both\n";
  }
  return 0;
}
