#include <stdio.h>

int solve(int,int);
int main(){
  
  int i,A[20],m[2000],n,q;

  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<)

    solve()





  return 0;
}


int solve(i,m){
  if(m==0) return 1;
  if(i>=n) return 0;
  res = solve(i+1,m) || solve(i+1,m-A[i]);
  return res;

}