#include <bits/stdc++.h>
using namespace std;
struct info {
  long long val;
  string name;
};
info data[100000 + 10];
int main() {
  long long n, x, y;
  cin >> n >> x >> y;
  long long a[n + 10];
  for (int i = 1; i <= n; i++) cin >> a[i];
  vector<int> res;
  long long cnt1 = 0, cnt2 = 0;
  while (cnt1 < x || cnt2 < y) {
    if ((cnt2 + 1) * x > (cnt1 + 1) * y)
      res.push_back(1), cnt1++;
    else if ((cnt2 + 1) * x < (cnt1 + 1) * y)
      res.push_back(2), cnt2++;
    else {
      res.push_back(3);
      res.push_back(3);
      cnt1++;
      cnt2++;
    }
  }
  for (int i = 1; i <= n; i++) {
    a[i]--;
    int re = res[a[i] % (x + y)];
    if (re == 1)
      puts("Vanya");
    else if (re == 2)
      puts("Vova");
    else
      puts("Both");
  }
  return 0;
}
