#include <bits/stdc++.h>
using namespace std;
long long X, Y, N;
long long getReal(long long mid) {
  return max(max(mid / X / Y * X * Y, mid / X * X), mid / Y * Y);
}
pair<long long, long long> Count(long long mid) {
  long long limit = getReal(mid);
  pair<long long, long long> ret;
  if (limit / X * X > limit / Y * Y)
    ret.second = 0;
  else if (limit / X * X < limit / Y * Y)
    ret.second = 1;
  else
    ret.second = 2;
  ret.first = limit / X + limit / Y;
  return ret;
}
int main() {
  scanf("%I64d %I64d %I64d", &N, &X, &Y);
  swap(X, Y);
  for (long long i = 0; i < N; i++) {
    long long hits;
    long long ret;
    scanf("%I64d", &hits);
    long long s = 0, e = 1e18 + 5;
    while (s < e) {
      long long mid = (s + e) / 2;
      pair<long long, long long> r = Count(mid);
      if (r.first >= hits) {
        ret = r.second;
        e = mid - 1;
      } else
        s = mid + 1;
    }
    pair<long long, long long> r = Count(s);
    if (r.first >= hits) ret = r.second;
    if (!ret)
      printf("Vanya\n");
    else if (ret == 1)
      printf("Vova\n");
    else
      printf("Both\n");
  }
}
