#include <bits/stdc++.h>
using namespace std;
long long n, x, y, a, b, wa, wb, s, k, q, z, tab[2000005];
bool oka, okb;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> x >> y;
  s = x * y;
  a = s / x;
  b = s / y;
  wa = a;
  wb = b;
  k = 1;
  while (1) {
    if (wa < wb) {
      tab[k] = 1;
      wa += a;
      k++;
    } else if (wb < wa) {
      tab[k] = 2;
      wb += b;
      k++;
    } else {
      tab[k] = 3;
      k++;
      tab[k] = 3;
      wa += a;
      wb += b;
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> q;
    z = q % k;
    if (z == 0) z = k;
    if (tab[z] == 1)
      cout << "Vanya\n";
    else if (tab[z] == 2)
      cout << "Vova\n";
    else
      cout << "Both\n";
  }
  return 0;
}
