#include <bits/stdc++.h>
using namespace std;
int n;
long long x, y;
vector<string> winner(0);
int main() {
  int ii;
  int a;
  long long hitX = 0, hitY = 0;
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> x >> y;
  while ((hitX < x) || (hitY < y)) {
    if ((hitY * x + x) < (hitX * y + y)) {
      hitY++;
      winner.push_back("Vova");
    } else if ((hitY * x + x) > (hitX * y + y)) {
      hitX++;
      winner.push_back("Vanya");
    } else {
      hitX++;
      hitY++;
      winner.push_back("Both");
      winner.push_back("Both");
    }
  }
  for (ii = 0; ii < n; ii++) {
    cin >> a;
    cout << winner[(a - 1) % int(x + y)] << "\n";
  }
  cout << "\n"
       << "\n";
  return 0;
}
