#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  long long int x, y, n, t, i;
  double a = 1, b = 1;
  cin >> n >> x >> y;
  string str[x + y];
  i = 0;
  while (i < (x + y)) {
    if ((a / x) < (b / y)) {
      str[i] = "Vanya";
      a++;
      i++;
    } else if ((a / x) > (b / y)) {
      str[i] = "Vova";
      b++;
      i++;
    } else {
      a++;
      b++;
      str[i] = "Both";
      str[i + 1] = "Both";
      i += 2;
    }
  }
  while (n--) {
    cin >> t;
    cout << str[(t - 1) % (x + y)] << endl;
  }
  return 0;
}
