#include <bits/stdc++.h>
using namespace std;
int n, x, y;
void solve(int val) {
  val %= x + y;
  long long lb = 0, rb = (long long)x * y;
  while (lb <= rb) {
    long long mid = (rb - lb) / 2 + lb;
    long long hit = mid / x + mid / y;
    if (hit >= val)
      rb = mid - 1;
    else
      lb = mid + 1;
  }
  int flag = (lb % x == 0) << 1 | (lb % y == 0);
  switch (flag) {
    case 1:
      puts("Vanya");
      break;
    case 2:
      puts("Vova");
      break;
    case 3:
      puts("Both");
      break;
  }
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 0; i < n; ++i) {
    int val;
    scanf("%d", &val);
    solve(val);
  }
  return 0;
}
