#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, x, y;
  cin >> n >> x >> y;
  vector<string> v(x + y + 1);
  int countX = 1, countY = 1;
  for (int i = 1; i <= x + y; i++) {
    if (countX / x < countY / y) {
      v[i] = "Vanya";
      countX++;
    } else if (countX / x == countY / y) {
      v[i] = "Both";
      v[++i] = "Both";
      countX++;
      countY++;
    } else {
      v[i] = "Vova";
      countY++;
    }
  }
  int a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a % (int)(x + y) == 0)
      cout << "Both" << endl;
    else
      cout << v[a % (int)(x + y)] << endl;
  }
}
