#include <bits/stdc++.h>
using namespace std;
bool runtime = 0;
bool debug = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  {}
  int tc = 1;
  for (int tt = 1; tt <= tc; tt++) {
    long long n, x, y;
    cin >> n >> x >> y;
    long long cx = 0, cy = 0;
    vector<string> ans;
    while (cx < x || cy < y) {
      if ((cx + 1) * y > (cy + 1) * x) {
        ans.push_back("Vova");
        cy++;
      } else if ((cx + 1) * y < (cy + 1) * x) {
        ans.push_back("Vanya");
        cx++;
      } else {
        ans.push_back("Both");
        ans.push_back("Both");
        cx++, cy++;
      }
    }
    while (n--) {
      int t;
      cin >> t;
      t--;
      cout << ans[t % (x + y)] << '\n';
    }
  }
  return 0;
}
