#include <bits/stdc++.h>
using namespace std;
int N, aim;
double x, y;
vector<string> v;
int main() {
  scanf("%d %lf %lf", &N, &x, &y);
  for (int cntx = 0, cnty = 0; cntx <= x && cnty <= y;) {
    if ((cntx + 1) * y == (cnty + 1) * x) {
      v.push_back("Both");
      v.push_back("Both");
      cntx++, cnty++;
    } else if ((cntx + 1) * y >= (cnty + 1) * x) {
      v.push_back("Vova");
      cnty++;
    } else {
      v.push_back("Vanya");
      cntx++;
    }
  }
  for (int i = 1; i <= N; i++) {
    scanf("%d", &aim);
    cout << v[(aim - 1) % ((int)x + (int)y)] << endl;
  }
  return 0;
}
