#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  scanf("%d %d %d", &n, &x, &y);
  long long ll, rr, mid;
  long long a, b;
  while (n--) {
    ll = 1;
    rr = 1e18;
    long long pom = 1e18;
    long long p;
    scanf("%I64d", &p);
    while (ll <= rr) {
      mid = (ll + rr) >> 1;
      a = (mid / x);
      b = (mid / y);
      if (a + b >= p) {
        if (mid < pom) pom = mid;
        rr = mid - 1;
      } else
        ll = mid + 1;
    }
    if (pom % x < pom % y)
      cout << "Vova" << endl;
    else if (pom % x > pom % y)
      cout << "Vanya" << endl;
    else
      cout << "Both" << endl;
  }
}
