#include <bits/stdc++.h>
using namespace std;
int gcd(int p, int q) { return q == 0 ? p : gcd(q, p % q); }
int main() {
  long long n, ta, tb, t;
  long long na, nb;
  cin >> n >> ta >> tb;
  while (n--) {
    cin >> t;
    na = (t + 1) * ta / (ta + tb) - t * ta / (ta + tb);
    nb = (t + 1) * tb / (ta + tb) - t * tb / (ta + tb);
    if (na && nb) {
      puts("Both");
    } else if (na) {
      puts("Vanya");
    } else if (nb) {
      puts("Vova");
    } else {
      puts("Both");
    }
  }
  return 0;
}
