#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int SIZE = 1e6 + 10;
int main() {
  int n, x, y;
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 0; i < (n); ++i) {
    int(v);
    scanf("%d", &v);
    long long ll = 1, rr = 1e16;
    while (ll < rr) {
      long long mm = (ll + rr) >> 1;
      long long ker = mm / y + mm / x;
      if (ker >= v)
        rr = mm;
      else
        ll = mm + 1;
    }
    long long r1 = ll % y;
    long long r2 = ll % x;
    if (!r1 && !r2)
      puts("Both");
    else if (!r1)
      puts("Vanya");
    else
      puts("Vova");
  }
  return 0;
}
