#include <bits/stdc++.h>
const long long inf = 1000000000000000010LL;
using namespace std;
template <class T>
inline bool rd(T &ret) {
  char c;
  long long sgn;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1L : 1L;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
long long n, x, y;
int main() {
  rd(n), rd(x), rd(y);
  while (n--) {
    long long a, l, r;
    rd(a);
    l = 0LL;
    r = inf;
    while (l + 1LL < r) {
      long long m = l + r >> 1LL;
      if (m / x + m / y >= a)
        r = m;
      else
        l = m;
    }
    if (r % x > r % y)
      printf("Vanya\n");
    else if (r % x < r % y)
      printf("Vova\n");
    else
      printf("Both\n");
  }
  return 0;
}
