#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long x, y;
  cin >> n >> x >> y;
  long long max;
  vector<string> v;
  int pp;
  if (x == y) {
    for (int i = 0; i < n; i++) {
      cin >> pp;
      cout << "Both" << endl;
    }
    return 0;
  }
  long long curx = x, cury = y;
  while (1) {
    if (curx < cury) {
      v.push_back("Vova");
      curx += x;
    } else if (curx > cury) {
      v.push_back("Vanya");
      cury += y;
    } else {
      v.push_back("Both");
      v.push_back("Both");
      cury += y;
      curx += x;
    }
    if (curx == x * y && cury == x * y) break;
  }
  v.push_back("Both");
  v.push_back("Both");
  int a;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    cout << v[(a - 1) % v.size()] << endl;
  }
  return 0;
}
