#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int N, X, Y;
int a[maxn];
vector<int> V;
int p1 = 0, p2 = 0;
void ispisi(int x) {
  if (x == 1) printf("Vanya\n");
  if (x == 2) printf("Vova\n");
  if (x == 3) printf("Both\n");
}
int main(void) {
  scanf("%d%d%d", &N, &X, &Y);
  for (int i = 0; i < N; i++) scanf("%d", &a[i]);
  while (p1 < X || p2 < Y) {
    if ((long long int)(p1 + 1) * Y > (long long int)(p2 + 1) * X) {
      p2++;
      V.push_back(2);
      continue;
    } else if ((long long int)(p1 + 1) * Y < (long long int)(p2 + 1) * X) {
      p1++;
      V.push_back(1);
      continue;
    } else if ((long long int)(p1 + 1) * Y == (long long int)(p2 + 1) * X) {
      p2++;
      p1++;
      V.push_back(3);
      V.push_back(3);
      continue;
    }
  }
  for (int i = 0; i < N; i++) ispisi(V[(a[i] - 1) % (X + Y)]);
  return 0;
}
