#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, x, y;
  scanf("%d%d%d", &T, &x, &y);
  while (T--) {
    int n;
    scanf("%d", &n);
    long long l = 0, r = ((long long)x) * ((long long)n + 1);
    while (r - l > 1) {
      long long mid = (r + l) / 2;
      if (mid / y + mid / x >= n)
        r = mid;
      else
        l = mid;
    }
    if (r % x == 0 && r % y == 0)
      printf("Both\n");
    else if (r % x == 0)
      printf("Vova\n");
    else
      printf("Vanya\n");
  }
}
