#include <bits/stdc++.h>
using namespace std;
int cmpf(int n1, int d1, int n2, int d2) {
  long long v1 = (long long)(n1) * (d2);
  long long v2 = (long long)(n2) * (d1);
  if (v1 == v2) return 2;
  if (v1 > v2) return 1;
  return 0;
}
int main() {
  int n, a, x, y, i, j, n1, n2;
  scanf("%d%d%d", &n, &x, &y);
  int order[x + y - 1];
  int k = 1;
  order[0] = 2;
  i = j = 1;
  while (k < x + y) {
    int cp = cmpf(i, x, j, y);
    order[k++] = cp;
    if (cp == 1)
      ++j;
    else if (cp == 0)
      ++i;
    else {
      order[k++] = cp;
      ++i;
      ++j;
    }
  }
  while (n--) {
    scanf("%d", &a);
    a %= (x + y);
    if (order[a] == 0)
      puts("Vanya");
    else if (order[a] == 1)
      puts("Vova");
    else
      puts("Both");
  }
  return 0;
}
