#include <bits/stdc++.h>
using namespace std;
long long i, j, n, x, y, k, b;
long long a[12345678];
int main() {
  cin >> n >> x >> y;
  i = 1;
  j = 1;
  while (i <= x || j <= y) {
    if (i * y < j * x) {
      ++k;
      a[k] = 1;
      ++i;
    } else if (i * y > j * x) {
      ++k;
      a[k] = 2;
      ++j;
    } else {
      ++k;
      a[k] = 3;
      ++k;
      a[k] = 3;
      ++i;
      ++j;
    }
  }
  for (i = 0; i < n; ++i) {
    cin >> b;
    b = b % (x + y);
    if (a[b] == 1)
      cout << "Vanya" << endl;
    else if (a[b] == 2)
      cout << "Vova" << endl;
    else
      cout << "Both" << endl;
  }
}
