#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, m, p, k, x, y;
  long long s;
  cin >> n >> x >> y;
  for (i = 1; i <= n; i++) {
    scanf("%d", &p);
    if (x == y) {
      printf("Both\n");
      continue;
    }
    k = p / (x + y);
    p = p - k * (x + y);
    if (p == 0) {
      printf("Both\n");
      continue;
    }
    s = (long long)p * x;
    if (s % (x + y) == 0) {
      printf("Both\n");
      continue;
    }
    s = (long long)(p + 1) * x;
    if (s % (x + y) == 0) {
      printf("Both\n");
      continue;
    }
    if (x == 1) {
      printf("Vova\n");
      continue;
    }
    if (y == 1) {
      printf("Vanya\n");
      continue;
    }
    s = (long long)p * x;
    k = s % (x + y);
    j = k + 1;
    j %= (x + y);
    m = (k + x - 1);
    m %= (x + y);
    if (j == 0 || m == 0 || (j > m)) {
      printf("Vanya\n");
      continue;
    }
    printf("Vova\n");
  }
}
