#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e6 + 100;
long long a[MAXN];
long long n, x, y;
int main() {
  cin >> n >> x >> y;
  long long f, g;
  f = y;
  g = x;
  a[0] = 3;
  for (int i = 1; i < x + y; i++) {
    if (f < g) {
      a[i] = 1;
      f += y;
    } else if (g < f) {
      a[i] = 2;
      g += x;
    } else {
      a[i] = a[++i] = 3;
      g += x;
      f += y;
    }
  }
  int t = 0;
  for (int i = 1; i <= n; i++) {
    int p;
    cin >> p;
    p %= x + y;
    if (a[p] == 2)
      cout << "Vova" << endl;
    else if (a[p] == 1)
      cout << "Vanya" << endl;
    else
      cout << "Both" << endl;
  }
  return 0;
}
