#include <bits/stdc++.h>
using namespace std;
long long arr[2000010], x, y, n, a;
int main() {
  string op[3] = {"Vanya", "Vova", "Both"};
  memset(arr, -1, sizeof arr);
  cin >> n >> x >> y;
  long long lx = 1, ly = 1, step = 1;
  while ((lx <= x) && (ly <= y)) {
    if (ly * x > lx * y) {
      arr[step++] = 0;
      lx++;
    } else if (ly * x < lx * y) {
      arr[step++] = 1;
      ly++;
    } else {
      arr[step] = arr[step + 1] = 2;
      step += 2;
      lx++;
      ly++;
    }
  }
  for (int i = 0; i < n; ++i) {
    cin >> a;
    a %= (x + y);
    if (a == 0) {
      cout << op[arr[x + y]] << endl;
    } else
      cout << op[arr[a]] << endl;
  }
  return 0;
}
