#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long x, y;
  int a[100005];
  scanf("%d", &n);
  cin >> x;
  cin >> y;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    long long k = a[i];
    long long xx = k * x / (x + y);
    long long yy = k * y / (x + y);
    if (xx + yy == k) {
      printf("Both\n");
      continue;
    }
    if (xx + yy == k - 1) {
      xx++;
      yy++;
      if (xx * y > yy * x) {
        printf("Vova\n");
        continue;
      } else if (xx * y < yy * x) {
        printf("Vanya\n");
        continue;
      } else {
        printf("Both\n");
        continue;
      }
    } else {
      if ((xx + 2) * y > (yy + 1) * x) {
        printf("Vova\n");
        continue;
      } else if ((xx + 1) * y < (yy + 2) * x) {
        printf("Vanya\n");
        continue;
      } else if ((xx + 1) * y == (yy + 2) * x || (xx + 2) * y == (yy + 1) * x) {
        printf("Both\n");
        continue;
      }
      xx++;
      yy++;
      if (xx * y < yy * x) {
        printf("Vova\n");
        continue;
      } else if (xx * y > yy * x) {
        printf("Vanya\n");
        continue;
      } else {
        printf("Both\n");
        continue;
      }
    }
  }
}
