#include <bits/stdc++.h>
using namespace std;
long long x, y;
int find(long long h, long long l, long long r) {
  long long m = (r + l) / 2;
  if ((m * x / (x * y) + m * y / (x * y)) == h || l == r) {
    if (m * x / (x * y) * 1 / (double)x == m * y / (y * x) * 1 / (double)y)
      return 0;
    if (m * x / (x * y) * 1 / (double)x < m * y / (y * x) * 1 / (double)y)
      return 1;
    if (m * x / (x * y) * 1 / (double)x > m * y / (y * x) * 1 / (double)y)
      return 2;
  }
  if ((m * x / (x * y) + m * y / (x * y)) > h)
    return find(h, l, m);
  else
    return find(h, m + 1, r);
}
int main() {
  long long n, r, avg, k;
  long long sum = 0, ans = 0;
  scanf("%I64d %I64d %I64d", &n, &x, &y);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d", &r);
    r %= (x + y);
    if (r == 0) {
      printf("Both\n");
    } else {
      switch (find(r, 0, x * y)) {
        case 0:
          printf("Both\n");
          break;
        case 2:
          printf("Vanya\n");
          break;
        case 1:
          printf("Vova\n");
          break;
      }
    }
  }
}
