#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, y;
  cin >> n >> x >> y;
  while (n--) {
    int k;
    scanf("%d", &k);
    k %= (x + y);
    long long low = 0, high = 1100000000 * 1000000000LL;
    while (low < high) {
      long long mid = (low + high) / 2;
      long long cur = 0;
      cur += mid / x;
      cur += mid / y;
      if (cur >= k)
        high = mid;
      else
        low = mid + 1;
    }
    if (high % x == 0 && high % y == 0)
      puts("Both");
    else if (high % y == 0)
      puts("Vanya");
    else
      puts("Vova");
  }
}
