#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) {
    int val;
    cin >> val;
    long long low, mid, high;
    low = 0, high = 1e15;
    long long ans = high;
    while (low <= high) {
      mid = (low + high) / 2;
      long long dmg1, dmg2;
      dmg1 = mid / x;
      dmg2 = mid / y;
      if (dmg1 + dmg2 >= val) {
        ans = min(ans, mid);
        high = mid - 1;
      } else
        low = mid + 1;
    }
    bool f1, f2;
    f1 = f2 = 0;
    if (ans % x == 0) {
      f1 = 1;
    }
    if (ans % y == 0) {
      f2 = 1;
    }
    if (f1 && f2) {
      cout << "Both" << endl;
    } else if (f2) {
      cout << "Vanya" << endl;
    } else {
      cout << "Vova" << endl;
    }
  }
}
