#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  cin >> n >> x >> y;
  while (n--) {
    int a;
    cin >> a;
    a = a % (x + y);
    long long l = -1, h = (long long)x * y, mid;
    while (l + 1 < h) {
      mid = (l + h) / 2;
      long long ay = mid / y;
      long long ax = mid / x;
      if (ay + ax < a) {
        l = mid;
      } else {
        h = mid;
      }
    }
    if (h % x == 0 && h % y == 0) {
      cout << "Both" << endl;
    } else if (h % y == 0) {
      cout << "Vanya" << endl;
    } else {
      cout << "Vova" << endl;
    }
  }
  return 0;
}
