#include <bits/stdc++.h>
using namespace std;
struct node {
  int a, id, an;
} hit[100006];
int cmp1(node x, node y) { return x.a < y.a; }
int cmp2(node x, node y) { return x.id < y.id; }
int ans[3000000];
int main() {
  long long n, x, y;
  while (cin >> n >> x >> y) {
    for (int i = 0; i < n; i++) {
      cin >> hit[i].a;
      hit[i].id = i + 1;
    }
    sort(hit, hit + n, cmp1);
    long long a = 1, b = 1;
    long long mm = (long long)x * y;
    int num = 1;
    ans[0] = -1;
    while (a * x <= mm && b * y <= mm) {
      if (a * x > b * y) {
        ans[num++] = 1;
        b++;
      } else if (a * x < b * y) {
        ans[num++] = 0;
        a++;
      } else {
        ans[num++] = -1;
        break;
      }
    }
    for (int i = 0; i < n; i++) {
      hit[i].an = ans[hit[i].a % num];
    }
    sort(hit, hit + n, cmp2);
    for (int i = 0; i < n; i++) {
      if (hit[i].an == 1) {
        puts("Vanya");
      } else if (hit[i].an == 0) {
        puts("Vova");
      } else {
        puts("Both");
      }
    }
  }
  return 0;
}
