#include <bits/stdc++.h>
using namespace std;
long long i, i0, n, m, x, y, tmp, a, b, L, p1, p2, cnt, r, l, mid;
bool f;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  while (scanf("%lld %lld %lld", &n, &y, &x) != EOF) {
    L = y / gcd(x, y) * x;
    m = L / x + L / y - 1;
    while (n--) {
      scanf("%lld", &tmp);
      tmp %= m + 1;
      if (tmp == m || tmp == 0)
        printf("Both\n");
      else {
        l = 0, r = 10000000000000000;
        while ((mid / x + mid / y) != tmp) {
          mid = (l + r) / 2;
          if ((mid / x + mid / y) >= tmp)
            r = mid;
          else
            l = mid;
        }
        if (mid % y > mid % x)
          printf("Vanya\n");
        else
          printf("Vova\n");
      }
    }
  }
  return 0;
}
