#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (!a) return b;
  return gcd(b % a, a);
}
bool solve(long long mx, long long ix, long long iy, long long a) {
  long long tx = mx * ix;
  long long my = tx / iy;
  return mx + my >= a;
}
int main(int argc, char const* argv[]) {
  int n, x, y;
  scanf("%d %d %d", &n, &x, &y);
  long long z = ((long long)x * y) / gcd(x, y);
  for (int i = 0; i < n; i += 1) {
    int a;
    scanf("%d", &a);
    long long incx = z / x;
    long long incy = z / y;
    bool chg = false;
    if (incx > incy) {
      chg = true;
      swap(incx, incy);
    }
    long long lo = 1;
    long long hi = a;
    while (hi - lo > 1LL) {
      long long mid = (lo + hi) / 2LL;
      if (solve(mid, incx, incy, a))
        hi = mid;
      else
        lo = mid;
    }
    long long ansx = solve(lo, incx, incy, a) ? lo : hi;
    long long tx = ansx * incx;
    long long ansy = tx / incy;
    long long ty = ansy * incy;
    if (chg) {
      swap(tx, ty);
      swap(ansx, ansy);
      swap(incx, incy);
    }
    if (ansx + ansy > a) {
      if (tx == ty)
        printf("Both\n");
      else if (tx < ty)
        printf("Vanya\n");
      else
        printf("Vova\n");
    } else {
      if (tx > ty)
        printf("Vanya\n");
      else if (tx < ty)
        printf("Vova\n");
      else if (tx == ty)
        printf("Both\n");
    }
  }
  return 0;
}
