#include <bits/stdc++.h>
using namespace std;
int status[2000009];
int main() {
  int n, x, y;
  scanf("%d", &n);
  scanf("%d", &x);
  scanf("%d", &y);
  status[0] = 0;
  int itr = 1;
  long long xi = y, yi = x;
  while (itr <= (x + y)) {
    if (xi == yi) {
      status[itr] = 0;
      itr++;
      status[itr] = 0;
      itr++;
      xi += y;
      yi += x;
    } else if (xi < yi) {
      status[itr] = 1;
      itr++;
      xi += y;
    } else {
      status[itr] = -1;
      itr++;
      yi += x;
    }
  }
  int a;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    a = a % (x + y);
    if (status[a] == 0) {
      printf("Both\n");
    } else if (status[a] == 1) {
      printf("Vanya\n");
    } else
      printf("Vova\n");
  }
}
