#include <bits/stdc++.h>
const long long maxn = 110000;
long long n, x, y;
long long a;
long long get1(long long n) { return n + (n * y / x) >= a; }
long long get2(long long n) { return n + (n * x / y) >= a; }
void solve() {
  long long low = 0, high = a;
  while (low < high) {
    long long mid = (low + high) >> 1;
    if (get1(mid)) {
      high = mid;
    } else {
      low = mid + 1;
    }
  }
  while (!get1(low)) low++;
  long long low1 = low;
  long long ans1 = (long long)low * (long long)y;
  low = 0, high = a;
  while (low < high) {
    long long mid = (low + high) >> 1;
    if (get2(mid)) {
      high = mid;
    } else {
      low = mid + 1;
    }
  }
  while (!get2(low)) low++;
  long long low2 = low;
  long long ans2 = (long long)low * (long long)x;
  if (ans1 < ans2 || (ans1 == ans2 && low1 - 1 + low1 * y / x < a &&
                      !(low2 - 1 + low2 * x / y < a))) {
    printf("Vanya\n");
  } else if (ans2 < ans1 || (ans1 == ans2 && low2 - 1 + low2 * x / y < a &&
                             !(low1 - 1 + low1 * y / x < a))) {
    printf("Vova\n");
  } else {
    printf("Both\n");
  }
}
int main() {
  scanf("%I64d%I64d%I64d", &n, &x, &y);
  for (long long i = 0; i < n; ++i) {
    scanf("%I64d", &a);
    solve();
  }
  return 0;
}
