#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int n, x, y;
vector<int> g;
int main() {
  cin >> n >> x >> y;
  int tmp = gcd(x, y);
  x /= tmp;
  y /= tmp;
  long long currx = 0;
  long long curry = 0;
  for (int i = 1; i <= x + y; i++) {
    if ((currx + 1) * y < (curry + 1) * x) {
      currx++;
      g.push_back(1);
    } else if ((currx + 1) * y > (curry + 1) * x) {
      curry++;
      g.push_back(2);
    } else {
      curry++;
      currx++;
      g.push_back(3);
      g.push_back(3);
    }
  }
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    a = a % (x + y);
    a--;
    if (a < 0) a = x + y - 1;
    if (g[a] == 1) {
      cout << "Vanya\n";
    } else if (g[a] == 2) {
      cout << "Vova\n";
    } else
      cout << "Both\n";
  }
  return 0;
}
