#include <bits/stdc++.h>
long long x, y, l, r, mid, a;
int main() {
  int n;
  scanf("%d%d%d", &n, &x, &y);
  int i;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a);
    l = 0, r = 1e15;
    while (l <= r) {
      mid = (l + r) / 2;
      if (mid / x + mid / y >= a)
        r = mid - 1;
      else
        l = mid + 1;
    }
    mid = r + 1;
    if (mid % y == 0 && mid % x != 0)
      printf("Vanya\n");
    else if (mid % y != 0 && mid % x == 0)
      printf("Vova\n");
    else if (mid % y == 0 && mid % x == 0)
      printf("Both\n");
  }
  return 0;
}
