#include <bits/stdc++.h>
using namespace std;
int v[2000000];
int main() {
  int n;
  int x, y, z;
  cin >> n >> x >> y;
  z = x - y;
  double a = 1 / x, b = 1 / y, c = 1 / x, d = 1 / y, k = a - b;
  int idx = 0, i;
  for (i = 0;; i++) {
    if (!z) {
      v[idx++] = 3, a += c, b += d;
      v[idx++] = 3;
      break;
    } else if (z < 0) {
      v[idx++] = 2;
      b += d;
      z += x;
    } else if (z > 0) {
      v[idx++] = 1;
      a += c;
      z -= y;
    }
  }
  for (int j = 0; j < n; j++) {
    cin >> z;
    z--;
    if (v[z % idx] == 1)
      cout << "Vanya\n";
    else if (v[z % idx] == 2)
      cout << "Vova\n";
    else
      cout << "Both\n";
  }
  return 0;
}
