#include <bits/stdc++.h>
using namespace std;
long long n, x, y;
long long bs1(long long l, long long r, long long num) {
  long long mid = (l + r) / 2;
  if (r - l <= 0) {
    return -1;
  }
  long long time = mid * x;
  long long highnow = mid + ((mid * x + x - 1) / y);
  long long lownow = mid + ((time) / y);
  if (highnow >= num && lownow < num) {
    return mid;
  }
  if (highnow < num) {
    return bs1(mid + 1, r, num);
  }
  return bs1(l, mid, num);
}
long long bs2(long long l, long long r, long long num) {
  long long mid = (l + r) / 2;
  if (r - l <= 0) {
    return -1;
  }
  long long time = mid * y;
  long long highnow = mid + ((mid * y + y - 1) / x);
  long long lownow = mid + ((time) / x);
  if (highnow >= num && lownow < num) {
    return mid;
  }
  if (highnow < num) {
    return bs2(mid + 1, r, num);
  }
  return bs2(l, mid, num);
}
int main() {
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) {
    long long num;
    cin >> num;
    long long ansy = bs1(0, num + 1, num);
    long long ansx = bs2(0, num + 1, num);
    if (ansy == -1 && ansx == -1) {
      cout << "Both" << endl;
      continue;
    }
    if (ansx == -1) {
      cout << "Vanya" << endl;
      continue;
    }
    if (ansy == -1) {
      cout << "Vova" << endl;
      continue;
    }
    cout << "Both" << endl;
  }
}
