#include <bits/stdc++.h>
using namespace std;
const long long oo = 1000000000000000009ll;
int n, x, y;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> x >> y;
  for (int i = 1; i <= n; i++) {
    int q;
    cin >> q;
    long long low = 0, high = oo;
    while (low < high) {
      long long mid = (low + high) / 2;
      if (mid / x + mid / y >= q) {
        high = mid;
      } else {
        low = mid + 1;
      }
    }
    if (!(low % x) && !(low % y)) {
      cout << "Both\n";
    } else if (!(low % x)) {
      cout << "Vova\n";
    } else {
      cout << "Vanya\n";
    }
  }
  return 0;
}
