#include <bits/stdc++.h>
using namespace std;
int ans[2000010];
int main() {
  ios_base::sync_with_stdio(0);
  long long int n, x, y, nx, ny, vx, vy, a, z;
  cin >> n >> x >> y;
  z = x + y;
  nx = ny = 0;
  vx = y;
  vy = x;
  while (nx + ny < z) {
    if (vx < vy) {
      vx += y;
      nx++;
      ans[nx + ny] = 1;
    } else if (vx > vy) {
      vy += x;
      ny++;
      ans[nx + ny] = 2;
    } else {
      vx += y;
      vy += x;
      nx++;
      ny++;
      ans[nx + ny] = ans[nx + ny - 1] = 0;
    }
  }
  while (n--) {
    cin >> a;
    a = a % z;
    if (!ans[a])
      cout << "Both\n";
    else {
      if (ans[a] == 1)
        cout << "Vanya\n";
      else
        cout << "Vova\n";
    }
  }
  return 0;
}
