#include <bits/stdc++.h>
int n, x, y, a[100001], i, c[2000001], t;
double m, p, q;
int gdc(int a, int b) {
  if (a < b) return gdc(b, a);
  if (b == 0) return a;
  return gdc(b, a % b);
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  t = gdc(x, y);
  x /= t;
  y /= t;
  p = q = 1.0;
  for (i = 1; i < x + y - 1; i++) {
    if (p / x > q / y) {
      c[i] = 2;
      q += 1;
    } else {
      c[i] = 1;
      p += 1;
    }
  }
  for (i = 0; i < n; i++) {
    a[i] %= x + y;
    if (c[a[i]] == 1)
      printf("Vanya\n");
    else if (c[a[i]] == 2)
      printf("Vova\n");
    else
      printf("Both\n");
  }
}
