#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
const long long mod = 1e9 + 7, INF = 1 << 30;
int n, x, y;
vector<pair<long long, long long> > a;
void init(void) {
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 1; i <= x; i++)
    a.push_back(pair<long long, long long>(1LL * i * y, 1));
  for (int i = 1; i <= y; i++)
    a.push_back(pair<long long, long long>(1LL * i * x, 2));
  sort(a.begin(), a.end());
}
void process(void) {
  for (int i = 1; i <= n; i++) {
    int t;
    scanf("%d", &t);
    t %= (x + y);
    if (t == 0)
      printf("Both\n");
    else if (a[t - 1].second == 1 && a[t - 1].first != a[t].first)
      printf("Vanya\n");
    else if (a[t - 1].second == 2 &&
             (t == 1 || a[t - 1].first != a[t - 2].first))
      printf("Vova\n");
    else
      printf("Both\n");
  }
}
int main(void) {
  init();
  process();
  return 0;
}
