#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b, c;
  cin >> n >> b >> c;
  int van = 0;
  int vov = 0;
  int sze = b + c;
  string *tap = new string[sze];
  bool both = false;
  for (int i = 0; i < b + c; i++) {
    if (both) {
      tap[i] = "Both";
      both = false;
    } else {
      if ((double)(van + 1) / (double)b < (double)(vov + 1) / (double)c) {
        tap[i] = "Vanya";
        van += 1;
      } else if ((double)(van + 1) / (double)b ==
                 (double)(vov + 1) / (double)c) {
        tap[i] = "Both";
        both = true;
        van += 1;
        vov += 1;
      } else {
        tap[i] = "Vova";
        vov += 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    long x;
    cin >> x;
    cout << tap[(x - 1) % (b + c)] << endl;
  }
}
