#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int MAXN = 2000005;
const int MOD = 1e9 + 7;
const int MOD1 = 1e9 + 35011;
const int MOD2 = 1e9 + 18169;
const int INF = (1 << 30);
const long long INFl = 1e18;
int n, x, y;
string mas[3] = {"Vanya", "Vova", "Both"};
int ans[MAXN];
void calc() {
  ans[0] = 2;
  int cnt = 0;
  long long tx = x, ty = y;
  while (cnt < x + y) {
    if (tx < ty) {
      ans[++cnt] = 1;
      tx += x;
    } else if (ty < tx) {
      ans[++cnt] = 0;
      ty += y;
    } else {
      ans[++cnt] = 2;
      ans[++cnt] = 2;
      tx += x;
      ty += y;
    }
  }
}
int main() {
  scanf("%d %d %d", &n, &x, &y);
  calc();
  int c = x + y;
  while (n--) {
    int temp;
    scanf("%d", &temp);
    temp %= c;
    cout << mas[ans[temp]] << endl;
  }
  return 0;
}
