#include <bits/stdc++.h>
using namespace std;
long long arr[100005];
int gcd(int a, int b) {
  int c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
int ans[3000006];
int main() {
  int n, x, y;
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) cin >> arr[i];
  int gc = gcd(x, y);
  long long t1 = 0;
  long long t2 = 0;
  long long xx = (long long)x;
  long long yy = (long long)y;
  int i = 0;
  for (; i < x + y; i++) {
    if (xx * (t1 + 1) > yy * (t2 + 1)) {
      t2++;
      ans[i] = 2;
    } else if (xx * (t1 + 1) < yy * (t2 + 1)) {
      t1++;
      ans[i] = 1;
    } else {
      t2++;
      ans[i] = 3;
      t1++;
      ans[i + 1] = 3;
      i++;
    }
  }
  for (int j = 0; j < n; j++) {
    long long tm = (arr[j] - 1) % (x + y);
    if (ans[tm] == 1)
      cout << "Vova\n";
    else if (ans[tm] == 2)
      cout << "Vanya\n";
    else
      cout << "Both\n";
  }
}
