int main () {
  int a[20], n, q, m[200], i, j;

  scanf("%d", &n);
  for(i = 0 ; i < n ; i++) {
    scanf("%d", &a[i]);
  }

  i = 0;
  
  scanf("%d", &q);
  for(j = 0 ; j < q ; j++) {
    scanf("%d", &m[j]);
    printf("%s\n", solve(n,m[j]));
  }
  return 0;
}

char solve(int i, int m){
  char res[];
  if(m == 0) return "true";
  if(i >= n) return "false";

  if(solve(i+1,m) == "true" || solve(i+1,m[i]) == "true")