#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  long long int x, y;
  scanf("%lld%lld%lld", &t, &x, &y);
  vector<int> v;
  long long int cntx = 0, cnty = 0;
  while (cntx < x || cnty < y) {
    if ((cntx + 1) * y < (cnty + 1) * x) {
      v.push_back(1);
      cntx++;
    } else if ((cntx + 1) * y > (cnty + 1) * x) {
      v.push_back(2);
      cnty++;
    } else if ((cntx + 1) * y == (cnty + 1) * x) {
      v.push_back(3);
      v.push_back(3);
      cntx++;
      cnty++;
    }
  }
  long long int i, p;
  while (t--) {
    scanf("%lld", &p);
    int tmp = v[(p - 1) % (x + y)];
    if (tmp == 1)
      puts("Vanya");
    else if (tmp == 2)
      puts("Vova");
    else if (tmp == 3)
      puts("Both");
  }
}
