#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  gcd(b % a, a);
}
vector<string> res;
int main(int argc, char** argv) {
  long long n, x, y;
  int first = 0;
  int second = 0;
  cin >> n >> x >> y;
  for (int i = 0; i <= x + y; i++) {
    if ((double)(first + 1) / x > (double)(second + 1) / y)
      res.push_back("Vova"), second++;
    else if ((double)(first + 1) / x < (double)(second + 1) / y)
      res.push_back("Vanya"), first++;
    else {
      first++;
      second++;
      res.push_back("Both");
      res.push_back("Both");
    }
  }
  while (n--) {
    int xx;
    scanf("%d", &xx);
    cout << res[(xx + x + y - 1) % (x + y)] << endl;
  }
  return 0;
}
