#include <stdio.h>

int solve(int, int);
int a[20], n;

int main () {
  int 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]);
    if(solve(i,m[j])) printf("true\n");
    else printf("false\n");
  }
  return 0;
}

int solve(int i, int m){
  
  if(m == 0) return 1;
  if(i >= n) return 0;

  if(solve(i+1,m) || solve(i+1,m-a[i])) return 1;
}