#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  double x, y, hp;
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) {
    cin >> hp;
    double L = 0.0, R = 1e10;
    for (int j = 0; j < 200; j++) {
      double mid = L + (R - L) / 2.0;
      long long c1 = mid * x, c2 = mid * y;
      if (c1 + c2 >= hp)
        R = mid;
      else
        L = mid;
    }
    int sol = 0;
    double temp1 = R * (double)x, temp2 = R * (double)y;
    int s = (int)(temp1 + 1e-9);
    if (fabs(temp1 - s) <= 1e-9) sol++;
    s = (int)(temp2 + 1e-9);
    if (fabs(temp2 - s) <= 1e-9) sol += 2;
    if (sol == 1)
      cout << "Vanya\n";
    else if (sol == 2)
      cout << "Vova\n";
    else
      cout << "Both\n";
  }
  return 0;
}
