#include <bits/stdc++.h>
using namespace std;
int n, x, y, c, c1, c2;
int ans[2000001];
int f(int a, int b, int c, int d) {
  long long X = (long long)a * (long long)d;
  long long Y = (long long)c * (long long)b;
  if (X == Y)
    return 0;
  else if (X < Y)
    return 1;
  return 2;
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  while (c < x + y - 2) {
    int tmp = f(c1 + 1, x, c2 + 1, y);
    if (!tmp)
      c1++, c2++, c += 2;
    else if (tmp == 1) {
      ans[++c] = 1;
      c1++;
    } else {
      ans[++c] = 2;
      c2++;
    }
  }
  for (int i = 0, tmp; i < n; i++) {
    scanf("%d", &tmp);
    tmp %= x + y;
    if (ans[tmp] == 0) printf("Both\n");
    if (ans[tmp] == 1) printf("Vanya\n");
    if (ans[tmp] == 2) printf("Vova\n");
  }
  return 0;
}
