#include <bits/stdc++.h>
using namespace std;
const char *solve(long long x, long long y, long long a) {
  a %= x + y;
  if (a == 0) return "Both";
  long long l = 0, r = x * y + 1;
  while (l < r - 1) {
    long long m = (l + r) / 2;
    if (m / y + m / x < a)
      l = m;
    else
      r = m;
  }
  long long diff = r / y * y - r / x * x;
  if (diff < 0) return "Vova";
  if (diff > 0) return "Vanya";
  return "Both";
}
int main() {
  long long N, X, Y;
  cin >> N >> X >> Y;
  for (int i = 0; i < N; ++i) {
    long long a;
    cin >> a;
    cout << solve(X, Y, a) << "\n";
  }
  return 0;
}
