#include <bits/stdc++.h>
using namespace std;
long long n, x, y;
int bs(int a) {
  if (a == 0) return 2;
  int l = 0;
  int r = x;
  while (r - l > 1) {
    int m = (l + r) / 2;
    int n = m * y / x;
    if (m + n >= a)
      r = m;
    else
      l = m;
  }
  int nl = (l * y) / x;
  int nr = (r * y) / x;
  if (nl == nr)
    return 0;
  else if (nr * x == r * y) {
    if (nr - 1 + r == a || nr + r == a)
      return 2;
    else
      return 1;
  } else {
    if (nr + r == a)
      return 0;
    else
      return 1;
  }
}
int main() {
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    a %= (x + y);
    int c = bs(a);
    if (c == 0)
      printf("Vanya\n");
    else if (c == 1)
      printf("Vova\n");
    else
      printf("Both\n");
  }
}
