#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, tmpres = 1;
  cin >> n >> x >> y;
  long long ar;
  int res[x + y];
  long long a = 1, b = 1;
  while (true) {
    if (a / double(x) > b / double(y)) {
      res[tmpres++] = 2;
      b++;
    } else if (a / double(x) < b / double(y)) {
      res[tmpres++] = 1;
      a++;
    } else {
      res[tmpres++] = 3;
      res[tmpres++] = 3;
      a++;
      b++;
    }
    if (a == x + 1 && b == y + 1) break;
  }
  for (int i = 0; i < n; i++) {
    cin >> ar;
    if (res[ar % (x + y)] == 1)
      cout << "Vanya" << endl;
    else if (res[ar % (x + y)] == 2)
      cout << "Vova" << endl;
    else
      cout << "Both" << endl;
  }
}
