#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

ll read()
{
	ull n=0; ll f=1; char ch=getchar();
	for(;ch<'0'||'9'<ch;ch=getchar()) if(ch=='-') f=-1;
	for(;'0'<=ch&&ch<='9';ch=getchar()) n=(n<<3)+(n<<1)+(ch^48);
	return f*n;
}

const int N=2.5e5+5;
int n;
int a[N],b[N];

void Solve()
{
	int T=read(); n=read();
	for(int i=1;i<=n;i++) a[i]=read();
	for(int i=1;i<=n;i++) b[i]=read();
	int q=read();
	for(int i=1;i<=q;i++)
	{
		printf("114514\n");
		//da le deng yu bai da
		//suo yi bu da
	}
}

#define FILESIO 2
int main()
{
  #ifdef FILESIO
	freopen("match.in","r",stdin);
	freopen("match.out","w",stdout);
  #endif
    
    int T=1;
    //scanf("%d",&T);
    for(;T--;)
    {
    	Solve();
	}
  
  #ifdef FILESIO
	fclose(stdin);
	fclose(stdout);
  #endif
    return 0;
}

