#include <bits/stdc++.h>
using namespace std;
int v[8000010];
int main() {
  int n, x, y, t, i, j;
  while (scanf("%d%d%d", &n, &x, &y) != EOF) {
    double a = 1, b = 1;
    for (i = 0; i < x + y; i++) {
      if (a * y < b * x) {
        v[i] = 1;
        a += 1;
      } else if (a * y > b * x) {
        v[i] = 2;
        b += 1;
      } else {
        v[i++] = 0;
        v[i] = 0;
        a += 1;
        b += 1;
      }
    }
    while (n--) {
      scanf("%d", &t);
      t %= (x + y);
      if (t == 0) {
        if (v[x + y - 1] == 0)
          cout << "Both" << endl;
        else if (v[x + y - 1] == 1)
          cout << "Vanya" << endl;
        else if (v[x + y - 1] == 2)
          cout << "Vova" << endl;
      } else {
        if (v[t - 1] == 0)
          cout << "Both" << endl;
        else if (v[t - 1] == 1)
          cout << "Vanya" << endl;
        else if (v[t - 1] == 2)
          cout << "Vova" << endl;
      }
    }
  }
}
