#include <bits/stdc++.h>
using namespace std;
long long n, x, y, hp;
bool check(long long t) { return t / x + t / y >= hp; }
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> x >> y;
  while (n--) {
    cin >> hp;
    long long high = x * hp + 1, low = 0;
    while (high > low) {
      long long chs = (high + low) / 2;
      if (check(chs))
        high = chs;
      else
        low = chs + 1;
    }
    if (low % y == 0 && low % x == 0)
      cout << "Both" << endl;
    else if (low % y == 0)
      cout << "Vanya" << endl;
    else
      cout << "Vova" << endl;
  }
}
