#include <bits/stdc++.h>
using namespace std;
template <class _T>
inline string tostr(const _T& a) {
  ostringstream os("");
  os << a;
  return os.str();
}
const int MAXN = 100;
int main() {
  long long n, x, y;
  cin >> n >> x >> y;
  long long tot = (long long)1e18;
  for (int(i) = (0); (i) < (n); ++(i)) {
    long long lo = 0, hi = tot + 1, mid;
    long long val;
    cin >> val;
    while (lo + 1 < hi) {
      mid = (lo + hi) / 2;
      long long sum = mid / x + mid / y;
      if (sum >= val)
        hi = mid;
      else
        lo = mid;
    }
    if (hi % x == 0 && hi % y == 0)
      cout << "Both" << endl;
    else if (hi % y == 0)
      cout << "Vanya" << endl;
    else
      cout << "Vova" << endl;
  }
  return 0;
}
