#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, ai, cntx = 0, cnty = 0;
  cin >> n >> x >> y;
  vector<int> ans;
  for (int i = 0; i < x + y; i++) {
    double t1 = (cntx + 1) / (1.0 * x), t2 = (cnty + 1) / (1.0 * y);
    if (t1 > t2) {
      ans.push_back(2);
      cnty++;
    } else if (t2 > t1) {
      ans.push_back(1);
      cntx++;
    } else {
      ans.push_back(0);
      ans.push_back(0);
      cntx++;
      cnty++;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> ai;
    int res = ans[ai % (x + y) - 1];
    if (res == 1)
      cout << "Vanya" << endl;
    else if (res == 2)
      cout << "Vova" << endl;
    else
      cout << "Both" << endl;
  }
  return 0;
}
