#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, n;
  scanf("%d%d%d", &n, &x, &y);
  swap(x, y);
  for (int i = 1; i <= n; i++) {
    int m;
    scanf("%d", &m);
    long long l = 0, r = (long long)1e18;
    long long mid;
    while (1) {
      mid = (l + r) >> 1;
      if (mid / x + mid / y < m) {
        if ((mid + 1) / x + (mid + 1) / y >= m)
          break;
        else
          l = mid + 1;
      } else
        r = mid - 1;
    }
    l = mid;
    if ((l + 1) % x == 0 && (l + 1) % y == 0)
      puts("Both");
    else if ((l + 1) % x == 0)
      puts("Vanya");
    else
      puts("Vova");
  }
  return 0;
}
