#include <bits/stdc++.h>
using namespace std;
template <class T>
bool uin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool uax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cout << fixed;
  int N, X, Y;
  cin >> N >> X >> Y;
  for (int i = 0; i < (int)(N); ++i) {
    int A;
    cin >> A;
    long long l = 0, r = 1e18;
    while (r - l > 1) {
      long long m = (l + r) / 2;
      long long hits = m / X + m / Y;
      if (hits >= A)
        r = m;
      else
        l = m;
    }
    if (r % Y == 0 && r % X == 0)
      cout << "Both\n";
    else if (r % X)
      cout << "Vanya\n";
    else if (r % Y)
      cout << "Vova\n";
  }
  return 0;
}
