#include <bits/stdc++.h>
using namespace std;
long long power(long long b, long long e) {
  long long p = 1;
  while (e > 0) {
    if (e & 1) {
      p = (p * b) % 1000000007;
    }
    e = e >> 1;
    b = (b * b) % 1000000007;
  }
  return p;
}
vector<long long> ans;
int main() {
  long long n, i, j, p, q, l, r, s = 0, a, x, y, cx, cy;
  scanf("%lld", &n);
  scanf("%lld", &x);
  scanf("%lld", &y);
  for (cx = cy = 0; cx < x && cy < y;) {
    if ((cx + 1.0) / x > (cy + 1.0) / y + 1e-12) {
      ans.push_back(1);
      cy++;
    } else if ((cx + 1.0) / x + 1e-12 < (cy + 1.0) / y) {
      ans.push_back(2);
      cx++;
    } else {
      ans.push_back(3);
      ans.push_back(3);
      cy++;
      cx++;
    }
  }
  for (; n--;) {
    scanf("%lld", &a);
    s = ans[(a - 1) % (x + y)];
    if (s == 2)
      printf("%s", "Vanya\n");
    else if (s == 1)
      printf("%s", "Vova\n");
    else
      printf("%s", "Both\n");
  }
  return 0;
}
