#include <bits/stdc++.h>
using namespace std;
int n;
long long x, y, a;
int s[3000010];
int main() {
  scanf("%d%I64d%I64d", &n, &x, &y);
  long long mod = x + y - 1;
  long long muti = x * y, mx = y, my = x;
  for (int i = 1; i <= mod; i++) {
    if (mx < my) {
      s[i] = 1;
      mx += y;
    } else if (mx > my) {
      s[i] = 2;
      my += x;
    } else {
      s[i] = 0, s[i + 1] = 0;
      i++;
      my += x;
      mx += y;
    }
  }
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a);
    a %= (mod + 1);
    if (s[a] == 1)
      printf("Vanya\n");
    else if (s[a] == 2)
      printf("Vova\n");
    else
      printf("Both\n");
  }
  return 0;
}
