#include<stdio.h>
#define N 20
#define Q 200
int n,A[N],q,m[Q];
int S[N],bef;
char *solve(int,int);

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

char *solve(int i,int m){
  char res;
  if(m==0 || A[i] == bef) return "true";
  else if(i >= n) return "false";
  else  {
  res = *solve(i+1,m-A[i]);
  return &res;
  }
}