#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000050;
int T, x, y, a;
char ans[3][10] = {"Vanya", "Vova", "Both"};
int who[maxn], s;
inline int gcd(int u, int v) { return !v ? u : gcd(v, u % v); }
int main() {
  int i, j, g;
  long long sx, sy;
  scanf("%d%d%d", &T, &x, &y);
  swap(x, y);
  g = gcd(x, y);
  x /= g, y /= g;
  s = x + y;
  who[0] = who[s - 1] = 2;
  for (i = 1, sx = sy = 0; i < s - 1; i++) {
    if (sx + x < sy + y)
      who[i] = 0, sx += x;
    else
      who[i] = 1, sy += y;
  }
  while (T--) scanf("%d", &a), printf("%s\n", ans[who[a % s]]);
  return 0;
}
