#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int n, x, y;
int a[100000];
int z[2000000], nz;
void run() {
  scanf("%d%d%d", &n, &x, &y);
  {
    int g = gcd(x, y);
    if (g != 1) x /= g, y /= g;
  }
  for (int i = (0); i < (n); ++i) scanf("%d", &a[i]);
  for (int i = (0); i < (n); ++i) a[i] %= (x + y);
  for (int i = (0); i < (n); ++i)
    if (a[i] == 0) a[i] = x + y;
  {
    nz = 0;
    long long lx = 0, ly = 0;
    for (int i = (0); i < (x + y - 2); ++i) {
      assert(lx + y != ly + x);
      if (lx + y < ly + x) {
        z[nz++] = 0;
        lx += y;
      } else {
        z[nz++] = 1;
        ly += x;
      }
    }
    assert(lx + y == ly + x);
  }
  for (int i = (0); i < (n); ++i) {
    if (a[i] == x + y || a[i] == x + y - 1) {
      printf("Both\n");
      continue;
    }
    int ret = z[a[i] - 1];
    printf("%s\n", ret == 0 ? "Vanya" : "Vova");
  }
}
int main() {
  run();
  return 0;
}
