#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, x, y;
int main() {
  n = read();
  x = read();
  y = read();
  for (int i = 1; i <= n; i++) {
    int t = read();
    long long l = 0, r = 1e15, ans;
    while (l <= r) {
      long long mid = (l + r) >> 1;
      if (mid / x + mid / y >= t)
        ans = mid, r = mid - 1;
      else
        l = mid + 1;
    }
    if (ans % x == 0 && ans % y == 0)
      puts("Both");
    else if (ans % x)
      puts("Vanya");
    else
      puts("Vova");
  }
  return 0;
}
