#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN=200005;
int N,n,m,ans,M1,M2,x,y,cnt;
int b[MAXN],a[MAXN*3],c[MAXN],sum[MAXN*3],t[MAXN],d[MAXN];
int query(int x){ return lower_bound(b+1,b+1+cnt,x)-b; }
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;++i) scanf("%d",&t[i]),a[++N]=t[i];
    scanf("%d",&m);
    for(int i=1;i<=m;++i){
        scanf("%d%d",&c[i],&d[i]);
        a[++N]=c[i]; a[++N]=d[i];
    }
    sort(a+1,a+1+N);
    for(int i=1;i<=N;++i) if(i==1||a[i-1]!=a[i]) b[++cnt]=a[i];
    for(int i=1;i<=n;++i) sum[query(t[i])]++;
    // for(int i=1;i<=cnt;++i) printf("%d %d\n",b[i],sum[i]);
    for(int i=1;i<=m;++i){
        x=sum[query(c[i])],y=sum[query(d[i])];
        // printf("%d %d %d\n",i,x,y);
        if(x>M1) M1=x,M2=y,ans=i;
        else if(x==M1&&y>M2) M1=x,M2=y,ans=i;
    }
    printf("%d",ans);
    return 0;
}


//【离散化】
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;

int a[200005],b[200005],c[200005],d[200005];
int book[200005]={0};
int happy[200005]={0};
int satis[200005]={0}; int n;

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	int d_sum=0; a[0]=-0x3f3f3f3f;
	for(int i=1;i<=n;i++)
		if(a[i]!=a[i-1])
			d[++d_sum]=a[i],book[d_sum]++;
		else
			book[d_sum]++;
	int m;
	scanf("%d",&m);
	int lang1,lang2;
	for(int i=1;i<=m;i++)
	{
		scanf("%d%d",&lang1,&lang2);
		int place1=lower_bound(d+1,d+d_sum+1,lang1)-d;
		happy[i]=book[place1];
		int place2=lower_bound(d+1,d+d_sum+1,lang2)-d;
		satis[place2]=book[place2];
	}
	int ans_place=1;
	int happy_now=happy[1]; int satis_now=satis[1];
	for(int i=2;i<=m;i++)
	{
		if(happy[i]>happy_now||(happy[i]==happy_now&&satis[i]>satis_now))
		{
			ans_place=i;
			happy_now=happy[i];
			satis_now=satis[i];
		}
	}
	cout<<ans_place<<endl;

	return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<map>
#define N 200010
using namespace std;
map<int,int>s;
int a[N];
int b[N];
struct zz
{
    int a;
    int b;
}p[N];
int main()
{
    int n,m,i,j,k;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        //s用来统计a[i]的个数
        s[a[i]]++;
    }
    scanf("%d",&m);
    for(i=1;i<=m;i++)
        scanf("%d",&p[i].a);
    for(i=1;i<=m;i++)
        scanf("%d",&p[i].b);

    int mm=0;k=1;
    for(i=1;i<=m;i++)
    {
        //统计出现次数最多的语言的个数,并记录其在语音列表中---第一次出现-----的位置
        if(mm<s[p[i].a])
        {
            mm=s[p[i].a];
            k=i;
        }
    }

    //统计
    int kk=0;
    for(i=1;i<=m;i++)
    {
        //在mm相等的情况下，比较s[p[i].b]。记录s[p[i].b]最大的位置
        if(s[p[i].a]==mm)
        {
            if(kk<s[p[i].b])
            {
                kk=s[p[i].b];
                k=i;
            }
        }
    }

    printf("%d\n",k);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 200006;
int n, m, a[N], x[N], y[N], cinema[N*3], tot = 0, k, ans[N*3];

int find(int f) {
	return lower_bound(cinema + 1, cinema + k + 1, f) - cinema;
}

int main() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
		cinema[++tot] = a[i];
	}
	cin >> m;
	for (int i = 1; i <= m; i++) {
		scanf("%d", &x[i]);
		cinema[++tot] = x[i];
	}
	for (int i = 1; i <= m; i++) {
		scanf("%d", &y[i]);
		cinema[++tot] = y[i];
	}
	sort(cinema + 1, cinema + tot + 1);
	k = unique(cinema + 1, cinema + tot + 1) - (cinema + 1);
	memset(ans, 0, sizeof(ans));
	for (int i = 1; i <= n; i++) ans[find(a[i])]++;
	int ans0 = 1, ans1 = 0, ans2 = 0;
	for (int i = 1; i <= m; i++) {
		int ansx = ans[find(x[i])], ansy = ans[find(y[i])];
		if (ansx > ans1 || (ansx == ans1 && ansy > ans2)) {
			ans0 = i;
			ans1 = ansx;
			ans2 = ansy;
		}
	}
	cout << ans0 << endl;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <map>
#include <tr1/unordered_map>

#define rint register int
#define readint(x) scanf("%d",&(x))
#define putint(x) printf("%d ",(x))
#define sys system("pause")
using namespace std;
using namespace std::tr1;
const int maxn = 200000 + 2;
const int maxm = 200000 + 2;

unordered_map<int,int> ma;
int n , m, t;
int voil[maxm] , worl[maxm];
int ans = 1;

int main()
{
	readint(n);
	for(rint i=1; i<=n; i++){
		readint(t);
		ma[t]++;
	}
	readint(m);
	for(rint i=1; i<=m; i++) readint(voil[i]);
	for(rint i=1; i<=m; i++) readint(worl[i]);

	for(rint i=1; i<=m; i++){
		if((ma[voil[i]] > ma[voil[ans]]) || (ma[voil[i]] == ma[voil[ans]]&&ma[worl[i]]>ma[worl[ans]]))
			ans = i;
	}

	cout << ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<int,int> ca;
int n,m;
int b[200010],c[200010];
int t1,t2,ans;
inline int init()
{
    int s=0,w=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}
    return s*w;
}
int main()
{
    n=init();
    for(int i=1;i<=n;i++)
    {
    	int x=init();
    	ca[x]++;
    }
    m=init();
    for(int i=1;i<=m;i++)
    {
        b[i]=init();
    }
    for(int i=1;i<=m;i++)
    {
        c[i]=init();
    }
    for(int i=1;i<=m;i++)
    {
        if(ca[b[i]]>t1)
        {
            ans=i;
            t1=ca[b[i]];
            t2=ca[c[i]];
        }
        if(ca[b[i]]==t1)
        {
            if(t2>ca[c[i]])
            {
                t2=ca[c[i]];
                ans=i;
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}


#include<iostream>
#include<map>;
using namespace std;
int yuyin[200005],zimu[200005];
map<int,int>can;
int a[200005];
int num,m;
int main(){
	cin>>num;
	for(int i=1;i<=num;i++)
     cin>>a[i],can[a[i]]+=1;
     cin>>m;
     for(int i=1;i<=m;i++){
     	cin>>yuyin[i]>>zimu[i];
	 }
	 int best_movie=1,best_yuyin=0,best_zimu=0;
	for(int i=1;i<=m+1;i++){
		if(can[yuyin[i]]==best_yuyin&&can[zimu[i]]>best_zimu){
			best_movie=i;
			best_zimu=can[zimu[i]];
		}
		else if(can[yuyin[i]]>best_yuyin){
			best_movie=i;
			best_yuyin=can[yuyin[i]];
			best_zimu=can[zimu[i]];

		}
	}
	cout<<best_movie;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=2e5+10;
int a[N],b[N],c[N];
int sum[N*3];
int arr[N*3],num[N*3];int n,m,len,tp;
void discrete()
{
	sort(arr+1,arr+len+1);
	tp=0;
	for(int i=1;i<=len;i++)
	{
		if(i==1||arr[i-1]!=arr[i])
		{
			num[++tp]=arr[i];
		}
	}
}
int query(int x)
{
	return lower_bound(num+1,num+tp+1,x)-num;
}
int main()
{
	len=0;
	scanf("%d",&n);
	memset(sum,0,sizeof(sum));
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		arr[++len]=a[i];
	}
	scanf("%d",&m);
	for(int i=1;i<=m;i++)
	{
		scanf("%d",&b[i]);
		arr[++len]=b[i];
	}
	for(int i=1;i<=m;i++)
	{
		scanf("%d",&c[i]);
		arr[++len]=c[i];
	}
	discrete();
	for(int i=1;i<=n;i++)
	{
		int x=query(a[i]);
		sum[x]++;
	}
	int bmax=0,cmax=0,ans=0;
	for(int i=1;i<=m;i++)
	{
		int x=query(b[i]);
		int y=query(c[i]);
		if(sum[x]>bmax)
		{
			bmax=sum[x];cmax=sum[y];
			ans=i;
		}
		else if(sum[y]>cmax&&sum[x]==bmax)
		{
			cmax=sum[y];
			ans=i;
		}
	}
	printf("%d\n",ans);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 400005;
int n, m;
int a[N], b[N], c[N], d[N + N / 2], e[N + N / 2], k[N],t,v;
int ans1,ans2,ans;
void discrete(){
	sort(d+1,d+t+1);
	for(int i=1;i<=t;i++){
		if(i==1||d[i]!=d[i-1]) e[++v]=a[i];
	}
}

int query(int x){
	return lower_bound(e+1,e+1+v,x)-e;
}

int main(){
	ans=1;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		d[++t]=a[i];
	}

	cin>>m;

	for(int i=1;i<=m;i++){
		cin>>b[i];
		d[++t]=b[i];
	}

	for(int i=1;i<=m;i++){
		cin>>c[i];
		d[++t]=c[i];
	}

	discrete();

	for(int i=1;i<=n;i++) k[query(a[i])]++;

	for(int i=1;i<=m;i++){
		int x=k[query(b[i])],y=k[query(c[i])];
		if(x>ans1||(x==ans1&&y>ans2)){
			ans=i;
			ans1=x;
			ans2=y;
		}
	}
	cout<<d[ans];
}


#include<bits/stdc++.h>
using namespace std;
#define N 200001
int n,m,a[N],sa1[N],sa2[N],sum[N],cnt,b[N],len,ans,ax,ay;

inline int read()
{
	register int x=0;
	register char ch=getchar();
	while(!isdigit(ch)) ch=getchar();
	while(isdigit(ch)) x=x*10+(ch^48),ch=getchar();
	return x;
}

int query(int x)
{
	return lower_bound(b+1,b+len+1,x)-b;
}

int main()
{
	n=read();

	for(int i=1;i<=n;++i) a[i]=read(),b[++cnt]=a[i];

	m=read();
	for(int i=1;i<=m;++i) sa1[i]=read(),b[++cnt]=sa1[i];
	for(int i=1;i<=m;++i) sa2[i]=read(),b[++cnt]=sa2[i];

	sort(b+1,b+cnt+1);
	len=unique(b+1,b+cnt+1)-b-1;

	for(int i=1,x;i<=n;++i)
	{
		x=query(a[i]);
		sum[x]++;
	}

	for(int i=1,x,y;i<=m;++i)
	{
		x=query(sa1[i]),y=query(sa2[i]);
		if(sum[x]>sum[ax]) ans=i,ax=x,ay=y;
		else if(sum[x]==sum[ax] && sum[y]>sum[ay]) ans=i,ax=x,ay=y;
	}

	printf("%d\n",ans);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,m,a[200005],b[200005],c[200005],t[200005];
struct ZH
{
    int x,y,z;
}zh[200005];
struct Lan
{
 	int x,y;
}lan[400005];
bool cmp(ZH p,ZH q)
{
    if(p.x>q.x)return true;
    if(p.x==q.x&&p.y>q.y)return true;
    return false;
}
int erfen(int l,int r,int p)
{
    int mid=(l+r)>>1;
    if(l==r&&lan[l].x==p)return l;
    if(lan[mid].x==p)return mid;
    if(lan[mid].x<p&&lan[mid+1].x>p)return 0;
    if(lan[mid].x>p&&lan[mid-1].x<p)return 0;
    if(lan[mid].x<p)return erfen(mid+1,r,p);
     else return erfen(l,mid-1,p);
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    sort(a+1,a+n+1);
    int cnt=0;
    for(int i=1;i<=n;i++)
    {
    	if(a[i]!=a[i-1])
     	{
            cnt++;
            lan[cnt].x=a[i];
        }
        lan[cnt].y++;
    }
    scanf("%d",&m);
    for(int i=1;i<=m;i++)
    {
        scanf("%d",&b[i]);
        int k=erfen(1,cnt,b[i]);
        zh[i].x=lan[k].y;
    }
    for(int i=1;i<=m;i++)
	{
        scanf("%d",&c[i]);
        int k=erfen(1,cnt,c[i]);
        zh[i].y=lan[k].y;
    }
    for(int i=1;i<=m;i++)
     zh[i].z=i;
	sort(zh+1,zh+m+1,cmp);
	printf("%d",zh[1].z);
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int tab[200005],lab[200005],ji[200005];
int a[600005],n,m,cnt;
struct Node{
	int a,b;
	int xu;
}film[200005];
int query(int x){
	return lower_bound(lab+1,lab+1+cnt,x)-lab;
}
bool cmp(Node a,Node b){
	int t1=query(a.a);
	int t2=query(b.a);
	if(ji[t1]==ji[t2]){
		t1=query(a.b);
		t2=query(b.b);
	}
	return ji[t1]>ji[t2];
}
int main(){
	//freopen("9.in","r",stdin);
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&tab[i]);
		a[i]=tab[i];
	}

	scanf("%d",&m);
	for(int i=1;i<=m;i++){
		scanf("%d",&film[i].a);
		a[++n]=film[i].a;
		film[i].xu=i;
	}
	for(int i=1;i<=m;i++){
		scanf("%d",&film[i].b);
		a[++n]=film[i].b;
	}
	sort(a+1,a+1+n);
	for(int i=1;i<=n;i++){
		if(a[i]!=a[i-1]){
			lab[++cnt]=a[i];
			ji[cnt]++;
		}
		if(a[i]==a[i-1])
			ji[cnt]++;
	}
	for(int i=1;i<=n;i++){
		int t=query(tab[i]);
		ji[t]++;
	}
	sort(film+1,film+1+m,cmp);
	printf("%d",film[1].xu);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=100010;
int b[maxn],a[maxn],c[maxn];
int lan[maxn];
int num[maxn];
int discrete(int j,int k)
{
	int len=0;
	for(int i=1;i<=j;++i)
	lan[++len]=a[i];
	for(int i=1;i<=k;++i)
	{
		lan[++len]=b[i];
		lan[++len]=c[i];
	}
	sort(lan+1,lan+len+1);
	return unique(lan+1,lan+len+1)-(lan+1);
}
int query(int x,int len)
{
	return lower_bound(lan+1,lan+len+1,x)-lan;
}
int main()
{
	int n,m;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	scanf("%d",&a[i]);
	scanf("%d",&m);
	for(int i=1;i<=m;i++)
	scanf("%d",&b[i]);
	for(int i=1;i<=m;i++)
	scanf("%d",&c[i]);
	int len=discrete(n,m);
	for(int i=1;i<=n;i++)
	num[query(a[i],len)]++;
	int ans=1;
	int nummax1=0;
	int nummax2=0;
	for(int i=1;i<=m;i++)
	{
		int num1=num[query(b[i],len)];
		int num2=num[query(c[i],len)];
		if(num1>nummax1||num1==nummax1&&num2>nummax2)
		{
			ans=i;
			nummax1=num1;
			nummax2=num2;
		}
	}
	printf("%d\n",ans);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#define N 200005
using namespace std;

struct Obj {int x, y, z;} obj[N];
int n, m, cnt;
int a[N], b[N * 3], c[N * 3], d[N * 3];

int read()
{
	int x = 0; char c = getchar();
	while(c < '0' || c > '9') c = getchar();
	while(c >= '0' && c <= '9') {x = x * 10 + c - '0'; c = getchar();}
	return x;
}

int find(int x) {
	return lower_bound(b + 1, b + 1 + cnt, x) - b;
}

bool cmp(Obj u, Obj v)
{
	if(u.x == v.x) return u.y > v.y;
	return u.x > v.x;
}

int main()
{
	cin >> n;
	for(int i = 1; i <= n; i++) a[i] = read(), b[++cnt] = a[i];
	cin >> m;
	for(int i = 1; i <= m; i++) obj[i].x = read(), b[++cnt] = obj[i].x, obj[i].z = i;
	for(int i = 1; i <= m; i++) obj[i].y = read(), b[++cnt] = obj[i].y;
	cnt = unique(b + 1, b + 1 + cnt) - b - 1;
	for(int i = 1; i <= n; i++)
		c[find(a[i])]++, d[find(a[i])]++;
	for(int i = 1; i <= m; i++) obj[i].x = c[find(obj[i].x)], obj[i].y = d[find(obj[i].y)];
	sort(obj + 1, obj + 1 + m, cmp);
	cout << obj[1].z;
	return 0;
}


#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
const int N=2e5+10;
struct Node
{
    int q,w,e,r,id;
    bool operator <(Node a)const
    {
        if(e!=a.e) return e>a.e;
        return r>a.r;
    }
}b[N];
int a[N],c[N],cnt1,cnt2,t[N*3];
int n,m;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]),c[++cnt1]=a[i];
    scanf("%d",&m);
    for(int i=1;i<=m;i++)
        scanf("%d",&b[i].q),c[++cnt1]=b[i].q,b[i].id=i;
    for(int i=1;i<=m;i++)
        scanf("%d",&b[i].w),c[++cnt1]=b[i].w;
    sort(c+1,c+cnt1+1);
    cnt1=unique(c+1,c+cnt1+1)-c-1;
    for(int i=1;i<=n;i++)
        a[i]=lower_bound(c+1,c+cnt1+1,a[i])-c,t[a[i]]++;
    for(int i=1;i<=m;i++)
    {
        b[i].q=lower_bound(c+1,c+cnt1+1,b[i].q)-c;
        b[i].w=lower_bound(c+1,c+cnt1+1,b[i].w)-c;
        b[i].e=t[b[i].q];
        b[i].r=t[b[i].w];
    }
    sort(b+1,b+m+1);
    printf("%d",b[1].id);
}


#include<bits/stdc++.h>
#define _I inline
#define _R register
#define INF 0x3f3f3f3f
#define ll long long
#define memset(x,y) memset(x,y,sizeof(x))
#define mod 1000000007
using namespace std;
const int N=200005;
int n,m,nm,maxx1=-1,maxx2=-1,ans,A[3*N],a[N],b[N],c[N],h[3*N];
//char buf[1<<21],*p1=buf,*p2=buf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
_I int read(){
	int x=0;bool f=0;char ch=getchar();
	while(ch<'0'||ch>'9')f|=(ch=='-'),ch=getchar();
	while('0'<=ch&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	f&&(x=-x);
	return x;
}
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	n=read();
	for(_R int i=1;i<=n;++i)A[++nm]=a[i]=read();
	m=read();
	for(_R int i=1;i<=m;++i)A[++nm]=b[i]=read();
	for(_R int i=1;i<=m;++i)A[++nm]=c[i]=read();
	sort(A+1,A+n+2*m+1);
	nm=unique(A+1,A+n+2*m+1)-A-1;
	for(_R int i=1;i<=n;++i)a[i]=lower_bound(A+1,A+nm+1,a[i])-A,++h[a[i]];
	for(_R int i=1;i<=m;++i)b[i]=lower_bound(A+1,A+nm+1,b[i])-A;
	for(_R int i=1;i<=m;++i)c[i]=lower_bound(A+1,A+nm+1,c[i])-A;
	for(_R int i=1;i<=m;++i)
		if((h[b[i]]>maxx1)||(h[b[i]]==maxx1&&h[c[i]]>maxx2))maxx1=h[b[i]],maxx2=h[c[i]],ans=i;
	printf("%d",ans);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=210015;
map<int,int> mp;
int n,m,a[N],y[N],z[N],ans=1;
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
    	cin>>a[i];
		mp[a[i]]++;
    }
    cin>>m;
    for(int i=0;i<m;i++) cin>>y[i];
    for(int i=0;i<m;i++) cin>>z[i];
    for(int i=0;i<m;i++){
        if(mp[y[i]]>mp[y[ans]]) ans=i;
        else if(mp[y[i]]==mp[y[ans]]&&mp[z[i]]>mp[z[ans]]) ans=i;
    }
    cout<<ans+1;
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

const int maxn=2e5+10;
int n,m,scientist_l[maxn],dub_l[maxn],word_l[maxn];
int cinema[maxn*3],tot,cnt[maxn];
int ans0=1,ans1,ans2;

void init()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)  scanf("%d",&scientist_l[i]),cinema[++tot]=scientist_l[i];
	scanf("%d",&m);
	for(int i=1;i<=m;i++)  scanf("%d",&dub_l[i]),cinema[++tot]=dub_l[i];
	for(int i=1;i<=m;i++)  scanf("%d",&word_l[i]),cinema[++tot]=word_l[i];
}

int find(int x)
{
	return lower_bound(cinema+1,cinema+tot+1,x)-cinema;
}

int main()
{
	init();
	sort(cinema+1,cinema+tot+1);
	int k=unique(cinema+1,cinema+n+1)-(cinema+1);
	for(int i=1;i<=n;i++){
		cnt[find(scientist_l[i])]++;
	}
	for(int i=1;i<=m;i++){
		int a1=cnt[find(dub_l[i])],a2=cnt[find(word_l[i])];
		if(a1>ans1||( a1 == ans1 && a2>ans2)){
			ans0=i;
			ans1=a1;
			ans2=a2;
		}
	}
	printf("%d",ans0);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=2e5+50,M=2e5+50;
int a[N],t[M];
int b[M],c[M];
int s[M];
int cnt;
int lsh(int x){
    int le=1,ri=cnt;
    while(le<=ri){
    int mid=(le+ri)/2;
    if(t[mid]==x) return mid;
    if(x<t[mid]) ri=mid-1;
      else le=mid+1;
    }
    return 0;
}
int main(){
	int n;scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]),t[i]=a[i];
	sort(t+1,t+n+1);
	cnt=unique(t+1,t+n+1)-(t+1);
	for(int i=1;i<=cnt;i++) printf("%d ",t[i]);printf("\n");
	for(int i=1;i<=n;i++) s[lsh(a[i])]++;
	int m;scanf("%d",&m);
	for(int i=1;i<=m;i++) scanf("%d",&b[i]);
	for(int i=1;i<=m;i++) scanf("%d",&c[i]);
	int ans=1,ans1=0,ans2=0;
	for(int i=1;i<=m;i++){
		int x=lsh(b[i]),y=lsh(c[i]);
		if(s[x]>ans1||s[x]==ans1&&s[y]>ans2)
		  ans1=s[x],ans2=s[y],ans=i;
	}
	printf("%d\n",ans);
}


#include<iostream>
#include<queue>
#include<algorithm>
using namespace std;
int n,m;
int list[600010];
int tot=0;
int sound[200010],chara[200010];
int scien[200010];
int sum[600010];
int tmp[600010];
int tot2=0;
void discrete(){
	sort(tmp+1,tmp+1+tot2);
	for(int i=1;i<=tot2;i++){
		if(i==1||tmp[i]!=tmp[i-1]){
			tot++;
			list[tot]=tmp[i];
		}
	}
}

int query(int x){
	return lower_bound(list+1,list+1+tot,x) - list;
}

int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>scien[i];
		tot2++;
		tmp[tot2]=scien[i];
	}
	int m;
	cin>>m;
	for(int i=1;i<=m;i++){
		cin>>sound[i];

		tot2++;
		tmp[tot2]=sound[i];

	}
	for(int i=1;i<=m;i++){
		cin>>chara[i];
		tot2++;
		tmp[tot2]=chara[i];
	}
	discrete();
	for(int i=1;i<=n;i++){
		sum[query(scien[i])]++;
	}
	int ans=1;
	for(int i=2;i<=m;i++){
		int h1=query(sound[i]);
		int h2=query(sound[ans]);
		if(sum[h1]>sum[h2]){

			ans=i;
		}
		else if(sum[query(sound[i])]==sum[query(sound[ans])]&&sum[query(chara[i])]>sum[query(chara[ans])]){
			ans=i;
		}
	}
	cout<<ans;
	return 0;
}


#include<iostream>
#include<map>
#define MAXN 1000005
using namespace std;

int sound[MAXN],cha[MAXN];
int jf=-1;

map<int , int> shoot;

int main(){
	int n,m;int x;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x;
		shoot[x]++;
	}
	cin>>m;
	for(int i=1;i<=m;i++) cin>>sound[i];
	for(int i=1;i<=m;i++)cin>>cha[i];

	int ans=0;
	for(int i=1;i<=m;i++){
		if(jf < shoot[sound[i]])jf = shoot[sound[i]],ans = i;
		else if(jf == shoot[sound[i]]&&shoot[cha[i]]>shoot[cha[ans]])ans = i;
	}
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int  n,m,a[200005],b[200005],c[200005],o[1000005],r,num[1000005];
int seek(int x)
{
	if(x==0)return 0;
	return lower_bound(o+1,o+r+1,x)-o;
}
int main()
{
	int d=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		o[++d]=a[i];
	}
	scanf("%d",&m);
	for(int i=1;i<=m;i++)
	{
		scanf("%d %d",&b[i],&c[i]);
		o[++d]=b[i];
		o[++d]=c[i];
	}
	sort(o+1,o+d+1);
	r=unique(o+1,o+d+1)-(o+1);
	for(int i=r+1;i<=d;i++)
	o[i]=0;
	for(int i=1;i<=n;i++)
	{
		num[seek(a[i])]++;//存数量；
	}
	int maxlen=-1;int minlen=-1;
	int kfc=0,white=0,say=0;
	for(int i=1;i<=m;i++)
	{
		int f=num[seek(b[i])];
		int e=num[seek(c[i])];
		if(f==maxlen)
		{
			if(e>minlen)
			{
				say=i;
				maxlen=f;
				minlen=e;
			}
		}
		if(f>maxlen)
        {
        	say=i;
			maxlen=f;
			minlen=e;
		}
		if(e>kfc)
		{
			kfc=e;
			white=i;
		}
	}
	printf("%d",say);
	if(say==0)
		say=white;
	if(say==0 and white==0)
	say=1;

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <cstring>
#include <algorithm>
#include <cctype>
using namespace std;
const int maxn=200005;
map <int,int> lan;
struct Film{
    int voi,tit,index;
}film[maxn];
int n,m;
template <class T>inline void read(T &x)
{
    x=0;char c;int ne=0;
    while(!isdigit(c=getchar()))ne=c=='-';
    x=c-48;
    while(isdigit(c=getchar()))x=(x<<3)+(x<<1)+c-48;
    x=ne?-x:x;
}
inline bool cmp(const Film &x,const Film &y)
{
    if(lan[x.voi]==lan[y.voi])
    {
        return lan[x.tit]>lan[y.tit];
    }
    return lan[x.voi]>lan[y.voi];
}
int main()
{
    int x,mx=-1;
    scanf("%d",&n);
    for(register int i=1;i<=n;i++){
        read(x);
        lan[x]++;
    }
    scanf("%d",&m);
    for(register int i=1;i<=m;i++){
        read(film[i].voi);
        film[i].index=i;
    }
    for(register int i=1;i<=m;i++){
        read(film[i].tit);
    }
    //sort(film+1,film+1+m,cmp);
    int ok[maxn],cnt=0,ans;  //step-2
    for(register int i=1;i<=m;i++){
        if(lan[film[i].voi]>mx){
            cnt=0,mx=lan[film[i].voi];
            ok[++cnt]=i;
        }
        else if(lan[film[i].voi]==mx){
            ok[++cnt]=i;
        }
    }mx=-1;
    for(register int i=1;i<=cnt;i++){
        if(lan[film[ok[i]].tit]>mx){
            mx=lan[film[ok[i]].tit];ans=ok[i];
        }
    }
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
char buf[1<<20],*P1=buf,*P2=buf;
#define gc() (P1==P2&&(P2=(P1=buf)+fread(buf,1,1<<20,stdin),P1==P2)?EOF:*P1++)
#define TT template<class T>inline
TT bool read(T &x){
    x=0;char c=gc();bool f=0;
    while(c<48||c>57){if(c==EOF)return 0;f^=(c=='-'),c=gc();}
    while(47<c&&c<58)x=(x<<3)+(x<<1)+(c^48),c=gc();
    if(f)x=-x;return 1;
}
TT bool read(T&a,T&b){return read(a)&&read(b);}
TT bool read(T&a,T&b,T&c){return read(a)&&read(b)&&read(c);}
typedef long long ll;
#define Init(a,v) memset(a,v,sizeof(a))
#define lowbit(x) (x&(-x))
const ll MAXN=2e5+8,mod=1e9+7,inf=0x3f3f3f3f;
unordered_map<int,int>mp;
struct Ans{
    int pl,sa,id;
    bool operator<(const Ans&o)const{
        if(pl^o.pl)return pl>o.pl;
        return sa>o.sa;
    }
}ans[MAXN];
int n,m;
inline int query(int x){if(mp.count(x))return mp[x];return 0;}
int main() {
    read(n);
    for(int i=0,x;i<n;++i){
        read(x);
        if(mp.count(x))mp[x]++;
        else mp.insert({x,1});
    }
    read(m);
    for(int i=0,x;i<m;++i){
        read(x);
        ans[i].id=i;
        ans[i].pl=query(x);
    }
    for(int i=0,x;i<m;++i){
        read(x);
        ans[i].sa=query(x);
    }
    sort(ans,ans+m);
    printf("%d",ans[0].id+1);
    return 0;
}


#include<bits/stdc++.h>
#define MAXN 200005
#define INF 1000000005
using namespace std;
namespace Seg_Tree
{
	#define MAXM 5000005
	int val[MAXM],L[MAXM],R[MAXM];
	int tot=1;
	int add(int rt,int l,int r,int x)
	{
		if (!rt) rt=++tot;
		if (l==r)
		{
			val[rt]++;
			return rt;
		}
		int mid=(l+r)>>1;
		if (x<=mid) L[rt]=add(L[rt],l,mid,x);
		if (x>mid) R[rt]=add(R[rt],mid+1,r,x);
		return rt;
	}
	int ask(int rt,int l,int r,int x)
	{
		if (!rt) return 0;
		if (l==r) return val[rt];
		int mid=(l+r)>>1;
		if (x<=mid) return ask(L[rt],l,mid,x);
		if (x>mid) return ask(R[rt],mid+1,r,x);
	}
}
int n,m;
int a[MAXN],b[MAXN],c[MAXN];
int s[MAXN],top;
int maxx=-1,ans;
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		Seg_Tree::add(1,1,INF,a[i]);
	}
	scanf("%d",&m);
	for (int i=1;i<=m;i++)
	{
		scanf("%d",&b[i]);
		int x=Seg_Tree::ask(1,1,INF,b[i]);
		if (x>maxx)
		{
			maxx=x;
			s[top=1]=i;
		}
		else if (x==maxx) s[++top]=i;
	}
	for (int i=1;i<=m;i++) scanf("%d",&c[i]);
	maxx=-1;
	for (int i=1;i<=top;i++)
	{
		int x=s[i];
		int y=Seg_Tree::ask(1,1,INF,c[x]);
		if (y>maxx)
		{
			maxx=y;
			ans=x;
		}
	}
	if (!ans) puts("1");else printf("%d\n",ans);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,m,tot,sum,ansa,ansb,ans=1;
int a[200010],voice[200010],word[200010],c[900010],num[900010],d[200010];
//c[]用于离散化,它的用处是确定编号
//注意！c[]存的是离散化后各个编号所代表的数，而num[]是存各个编号所代表的数的个数,不要弄混！！！
void discrete(int t){//离散化到c[]
    sort(d+1,d+t+1);
    for (int i = 1; i <= t; i++)
    {
        if (i==1 || d[i] != d[i-1])
        {
            c[++sum] = d[i];
        }
    }
}

int find(int x){
    return lower_bound(c+1,c+sum+1,x)-c;
    //返回x在c[]中的位置（编号）
}

int main()
{
    cin>>n;

    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        d[++tot] = a[i];
    }

    cin>>m;

    for (int i = 1; i <= m; i++)
    {
        cin>> voice[i];
        d[++tot] = voice[i];
    }

    for (int i = 1; i <= m; i++)
    {
        cin >> word[i];
        d[++tot] = word[i];
    }

    discrete(tot);

    for (int i = 1; i <= n; i++)
    {
        num[find(a[i])] ++;
    }

    for (int i = 1; i <= m; i++)
    {
        int k=num[ find(voice[i]) ];
        int l=num[ find(word[i]) ];
        if(k > ansa || (k == ansa && l > ansb ) ){
            ansa = k;
            ansb = l;
            ans = i;
        }
    }

    print(ans);

    return 0;
}


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

const int maxn=2e5+10;

struct sci{
    int lis,lok;
}movie[maxn];

map<int,int>can;
int n,m,most=-1,ans1,ans;

int main(){
    int x;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>x;
        can[x]++;
    }
    cin>>m;
    for(int i=1;i<=m;i++)
        cin>>movie[i].lis;
    for(int i=1;i<=m;i++)
        cin>>movie[i].lok;
    for(int i=1;i<=m;i++){
        if(most<can[movie[ans].lis])
            ans=i,most=can[movie[i].lis];
        else if(most==can[movie[i].lis])
            if(can[movie[ans].lok]<can[movie[i].lok])
                ans=i;
    }
    cout<<ans<<'\n';
    return 0;
}


#include <iostream>
#include <map>
using namespace std;

map<int,int> p;
int see,ting;
int movien,renn;
int ans=1;
int sound[200010];
int seem[200010];
int main()
{
  cin>>renn;
  for(int i=1;i<=renn;i++)
  {
  	int x;
  	cin>>x;
  	p[x]++;
  }
  cin>>movien;
  for(int i=1;i<=movien;i++)
    cin>>sound[i];
  for(int i=1;i<=movien;i++)
    cin>>seem[i];
  for(int i=1;i<=movien;i++)
  {
  	int x=p[sound[i]];
  	int y=p[seem[i]];
  	if(x>see||x==see&&y>ting)
  	{
  	  ans=i;
  	  see=x;
  	  ting=y;
	}
  }
  cout<<ans<<endl;
  return 0;
}


#include <cstdio>
#include <algorithm>

using namespace std;
const int N = 400005;

int n, m;
int a[N], b[N], c[N], d[N + N / 2], e[N + N / 2], k[N];
int max_v, max_t;
//离散化
inline void discrete() {
	int t = 0;

	sort(d + 1, d + 1 + (n + 2 * m));
	for(int i = 1; i <= (n + 2 * m); ++i)
		if(i == 1 || d[i] != d[i - 1]) e[++t] = d[i];
	e[0] = t;
}
//二分搜索
inline int query(int x) {

	int l = 1, r = e[0], mid;
	while(l < r) {
		mid = (l + r) >> 1;
		if(e[mid] >= x) r = mid;
		else l = mid + 1;
	}
	return l;
}
int main() {
//	freopen("in.txt", "r", stdin);

	scanf("%d", &n);
	for(int i = 1; i <= n; ++i) scanf("%d", a + i);
	scanf("%d", &m);
	for(int i = 1; i <= m; ++i) scanf("%d", b + i);
	for(int i = 1; i <= m; ++i) scanf("%d", c + i);
	int t = 0;
	for(int i = 1; i <= n; ++i) d[++t] = a[i];
	for(int i = 1; i <= m; ++i) d[++t] = b[i];
	for(int i = 1; i <= m; ++i) d[++t] = c[i];

	discrete();//把所有语言离散化一遍

	sort(a + 1, a + 1 + n);
	for(int i = 1; i <= n; ++i) {//暴力统计
		int l = query(a[i]);
		k[l]++;
	}

	for(int i = 1; i <= n; ++i) {
		if(k[i] > max_v){
			max_v = k[i];
			max_t = i;
		}
	}

	max_t = e[max_t];
	printf("%d\n", max_t);
	return 0;
}


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

inline int read()
{
	int x=0;int f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

const int N=200010;
map<int,int>s;

struct node
{
    int a,b;
};

node p[N];

int main()
{
    int n=read();
    for(int i=0,x;i<n;i++)
    {
        x=read();
        s[x]++;
    }
    int m=read();
    for(int i=0;i<m;i++)
        p[i].a=read();
    for(int i=0;i<m;i++)
        p[i].b=read();
    int ans=0,k=0;
    for(int i=0;i<m;i++)
        if(ans<s[p[i].a])
        {
            ans=s[p[i].a];
             k=i;
        }
    int res=0;
    for(int i=0;i<m;i++)
        if(ans==s[p[i].a]&&res<s[p[i].b])
    {
        res=s[p[i].b];
        k=i;
    }
    cout<<k+1<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int lang[600005];
int n,m;
int b[600005];
int accept[200005],like[200005];
map<int,int> mp;
int tmp;

void discrete(){
	sort(lang+1,lang+n+2*m+1);
	for(int i=1;i<=n+2*m;i++){
		if(i==1||lang[i]!=lang[i-1]){
			b[++tmp]=lang[i];
		}
	}
	return ;
}
void solve(){
	for(int i=1;i<=n;i++){
		like[lower_bound(b+1,b+n+1,lang[i])-b]++;
		accept[lower_bound(b+1,b+n+1,lang[i])-b]++;
	}
}
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>lang[i];
	}
	cin>>m;
	for(int i=1;i<=m;i++){
		cin>>like[i]>>accept[i];
		lang[n+i]=like[i];
		lang[n+i+1]=accept[i];
	}
	discrete();
	solve();
	int Max=0,Maxn,Maxa;
	for(int i=1;i<=m;i++){
		if(like[i]>Max){
			Max=like[i];
			Maxn=i;
			Maxa=accept[i];
		}else if(like[i]==Max){
			if(accept[i]>Maxa){
				Maxn=i;
				Maxa=accept[i];
			}
		}
	}
	cout<<Maxn;
	return 0;
}


#include<cstdio>
#include<algorithm>
using namespace std;

const int N=200010;
int n,m,cnt,cur,c1,c2;
int a[N],b[N],c[N],p[N*3],q[N*3],k[N*3];

int read(int &x){
	int w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
	if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')
	x=x*10+ch-48,ch=getchar();
	x*=w;
}

void ls(){
	int t=0;
	sort(p+1,p+1+cnt);
	for(int i=1;i<=cnt;i++)
		if(i==1||p[i]!=p[i-1])q[++t]=p[i];
	cnt=t;
}

int er(int x){
	int l=1,r=cnt,mid;
	while(l<r){
		mid=l+r>>1;
		if(q[mid]>=x)r=mid;else l=mid+1;
	}
		return l;
}

int main(){
	read(n);
	for(int i=1;i<=n;i++){read(a[i]);p[++cnt]=a[i];}
	read(m);
	for(int i=1;i<=m;i++){read(b[i]);p[++cnt]=b[i];}
	for(int i=1;i<=m;i++){read(c[i]);p[++cnt]=c[i];}

	ls();//离散化
	for(int i=1;i<=n;i++)k[ er(a[i])]++;
	for(int i=1;i<=m;i++){
		int x=k[ er(b[i])],y=k[ er(c[i])];
		if(x>c1||(x==c1&&y>c2))
		cur=i,c1=x,c2=y;
	}
	printf("%d\n",cur);
	return 0;
}


#include<iostream>
#include<cctype>
#include<cstring>
#include<cstdio>
#include<map>
#define re register
using namespace std;
inline int read()
{
	int x=0,w=0;char ch=0;
	while(!isdigit(ch)) w|=ch=='-',ch=getchar();
	while(isdigit(ch)) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return w?-x:x;
 }
map<int,int> Hash;
int mova[200050], movs[200050];
int best, Next, n, m, movie=1;
int main()
{
	n=read();
	for(re int i=1;i<=n;i++) Hash[read()]++;
	m=read();
	for(re int i=1;i<=m;i++) mova[i]=read();
	for(re int i=1;i<=m;i++) movs[i]=read();
	for(re int i=1;i<=m;i++)
	{
		int a=Hash[mova[i]], s=Hash[movs[i]];
		if(a==best&&s>Next) Next=s,movie=i;
		 else if(a>best) movie=i,best=a,Next=s;
	}
	printf("%d",movie);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <cmath>
#include <algorithm>
#include <map>
#define ll long long
#define rei register int
#define bl putchar(' ')
#define ed putchar('\n')
#define Min(a,b) ((a)<(b)?(a):(b))
#define Max(a,b) ((a)>(b)?(a):(b))
#define Mabs(a,b) ((a)>(b)?(a)-(b):(b)-(a))
#define Abs(a) ((a)>0?(a):-(a))
#define test std::cout<<"this:"
#define inf 0x7f7f7f7f
#define dinf 0x3f3f3f3f
#define llinf 0x7f7f7f7f7f7f7f7f
#define lldinf 0x3f3f3f3f3f3f3f3f
#define pai acos(-1)
#define inv inline void
#define card system("pause")
#define read2(a,b) read(a),read(b)
#define read3(a,b,c) read(a),read(b),read(c)
template <typename QvQ>inv read(QvQ &x)
{
	x=0;int f=1;
	char c=getchar();
	for(;c<'0'||c>'9';c=getchar()) if(c=='-') f=-1;
	for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48);
	x=x*f;
}
template <typename QvQ>inv write(QvQ x)
{
	if(x<0) x=-x,putchar('-');
	if(x>9) write(x/10);
	putchar(x%10+'0');
}
std::map<int,int> num;
int temp,t2,n,m,a[200005],b[200005];
int main()
{
	int a1=0,a2=0,aout=1;
	read(n);
	for(rei i=1;i<=n;++i) read(temp),++num[temp];
	read(m);
	for(rei i=1;i<=m;++i) read(a[i]);
	for(rei i=1;i<=m;++i) read(b[i]);
	for(rei i=1;i<=m;++i)
	{
		int p1=a[i],p2=b[i];
		if(num[p1]>=a1)
		{
			if(num[p1]==a1)
			{
				if(num[p2]>p2)
				{
					a2=num[p2];
					aout=i;
				}
				continue;
			}
			a1=num[p1];
			a2=num[p2];
			aout=i;
		}
	}
	write(aout);
	return 0;
}


#include<iostream>
#include <map>
using namespace std;
int a[200001],b[200001],c[200001];
map<int, int> M;
int main()
{
    int n, m;
    scanf("%d",&n);
    for (int i=1;i<=n;i++)cin>>a[i];
    cin>>m;
    for (int i=1;i<=m;i++)cin>>b[i];
    for (int i=1;i<=m;i++)cin>>c[i];
    for(int i=1;i<=n;i++)
        if (M.find(a[i])!= M.end())M[a[i]]++;
        else	M.insert(make_pair(a[i], 1));
    pair<int,int> result=make_pair(M[b[1]],M[c[1]]);
    int res=1;
    for(int i=2;i<=m;i++)
    {
        if(M[b[i]]>result.first)
        {
            result.first=M[b[i]];
            result.second=M[c[i]];
            res=i;
        }
        else	if(M[b[i]]==result.first && M[c[i]]>result.second)
		{
			result.second=M[c[i]];
			res=i;
		}
    }
    cout<<res;
    return 0;
}


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

int n,m;
const int maxn = 2e5+5;
int a[maxn];
int sc[maxn];

hash_map<int,int>mp;
struct Mo
{
    int b;
    int c;
    int id;
} mov[maxn];

bool cmp(Mo a,Mo b)
{
    if(a.b == b.b)
        return a.c > b.c;
    return a.b > b.b;
}
int main()
{
    scanf("%d",&n);
    int tmp;
    int cnt = 0;
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&tmp);
        if(!mp[tmp])
        {
            mp[tmp] = ++cnt;
            sc[cnt]++;
        }
        else
            sc[mp[tmp]]++;
    }
    scanf("%d",&m);
    for(int i=1; i<=m; i++)
        scanf("%d",&tmp),mov[i].id = i,mov[i].b = sc[mp[tmp]];
    for(int i=1; i<=m; i++)
        scanf("%d",&tmp),mov[i].c = sc[mp[tmp]];
    sort(mov+1,mov+1+m,cmp);
    printf("%d\n",mov[1].id);
}


//【离散化】
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;

int a[200005],b[200005],c[200005],d[200005];
int book[200005]={0};
int happy[200005]={0};
int satis[200005]={0}; int n;

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	int d_sum=0; a[0]=-0x3f3f3f3f;
	for(int i=1;i<=n;i++)
		if(a[i]!=a[i-1])
			d[++d_sum]=a[i],book[d_sum]++;
		else
			book[d_sum]++;
	int m;
	scanf("%d",&m);
	int lang1,lang2;
	for(int i=1;i<=m;i++)
	{
		scanf("%d",&lang1);
		int place1=lower_bound(d+1,d+d_sum+1,lang1)-d;
		if(d[place1]==lang1)
			happy[i]=book[place1];
	}
	for(int i=1;i<=m;i++)
	{
		scanf("%d",&lang2);
		int place2=lower_bound(d+1,d+d_sum+1,lang2)-d;
		if(d[place2]==lang2)
			satis[i]=book[place2];
	}
	int ans_place=1;
	int happy_now=happy[1]; int satis_now=satis[1];
	for(int i=2;i<=m;i++)
	{
		if(happy[i]>happy_now||(happy[i]==happy_now&&satis[i]>satis_now))
		{
			ans_place=i;
			happy_now=happy[i];
			satis_now=satis[i];
		}
	}
	cout<<ans_place<<endl;

	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 200006;
int n, m, a[N], x[N], y[N], cinema[N*3], tot = 0, k, ans[N*3];

int find(int f) {
    return lower_bound(cinema + 1, cinema + k + 1, f) - cinema;
}

int main() {
    cin >> n;
    for (int i = 1; i <= n; i++) {
        scanf("%d", &a[i]);
        cinema[++tot] = a[i];
    }
    cin >> m;
    for (int i = 1; i <= m; i++) {
        scanf("%d", &x[i]);
        cinema[++tot] = x[i];
    }
    for (int i = 1; i <= m; i++) {
        scanf("%d", &y[i]);
        cinema[++tot] = y[i];
    }
    sort(cinema + 1, cinema + tot + 1);
    k = unique(cinema + 1, cinema + tot + 1) - (cinema + 1);
    memset(ans, 0, sizeof(ans));
    for (int i = 1; i <= n; i++) ans[find(a[i])]++;
    int ans0 = 1, ans1 = 0, ans2 = 0;
    for (int i = 1; i <= m; i++) {
        int ansx = ans[find(x[i])], ansy = ans[find(y[i])];
        if (ansx > ans1 || (ansx == ans1 && ansy > ans2)) {
            ans0 = i;
            ans1 = ansx;
            ans2 = ansy;
        }
    }
    cout << ans0 << endl;
    return 0;
}


#include<map>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
#define fo(i,a,b) for(register int i=a;i<=b;++i)
#define fd(i,a,b) for(register int i=a;i>=b;--i)
using namespace std;
template<class T>
inline void read(T &x){
    x=0;T f=1;char c;
    for(c=getchar();c<'0'||c>'9';f=((c=='-')?-1:f),c=getchar());
    for(;c>='0'&&c<='9';x=x*10+(c^48),c=getchar());x*=f;
}
template<class T>
inline void write(T a){
    if(a==0){putchar('0');return;}
    if(a<0)putchar('-'),a=-a;
    char c1[120];int h=0;
    while(a)c1[++h]=a%10+'0',a/=10;
    for(int i=h;i>=1;i--)putchar(c1[i]);return;
}
template<class T>
inline void write_(T a){write(a);putchar(' ');}
template<class T>
inline void writeln(T a){write(a);putchar('\n');};
//-------------------------------------------------

const int maxn=2e5+100;
int n,m,ans=1,maxx=-1,maxy=-1;
int a[maxn],r[maxn],b[maxn],index[maxn*3];
vector<int> v;

int getid(int x){
	return lower_bound(v.begin(),v.end(),x)-v.begin()+1;
}

int main(){
	read(n);
	fo(i,1,n){read(a[i]);v.push_back(a[i]);}
	read(m);
	fo(i,1,m){
		read(r[i]);
		v.push_back(r[i]);
	}
	fo(i,1,m){
		read(b[i]);
		v.push_back(b[i]);
	}
	sort(v.begin(),v.end());
	v.erase(unique(v.begin(),v.end()),v.end());
	fo(i,1,n){
		int t=getid(a[i]);
		index[t]++;
	}
	fo(i,1,m){
		int x=getid(r[i]);
		int y=getid(b[i]);
		if(index[x]>maxx){
			maxx=index[x];
			ans=i;
		}
		if(index[x]==maxx&&index[y]>maxy){
			ans=i;
			maxy=index[y];
		}
	}
	write(ans);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int lab[200005],ji[200005];
int tab[200005],n,m,cnt;
struct Node{
	int a,b;
	int xu;
}film[200005];
bool cmp(Node a,Node b){
	int t1=lower_bound(lab+1,lab+1+cnt,a.a)-lab;
	int t2=lower_bound(lab+1,lab+1+cnt,b.a)-lab;
	if(ji[t1]==ji[t2]){
		t1=lower_bound(lab+1,lab+1+cnt,a.b)-lab;
		t2=lower_bound(lab+1,lab+1+cnt,b.b)-lab;
	}
	return ji[t1]>ji[t2];
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&tab[i]);
	sort(tab+1,tab+1+n);
	for(int i=1;i<=n;i++){
		if(tab[i]!=tab[i-1]){
			lab[++cnt]=tab[i];
			ji[cnt]++;
		}
		if(tab[i]==tab[i-1])
			ji[cnt]++;
	}
	scanf("%d",&m);
	for(int i=1;i<=m;i++){
		scanf("%d",&film[i].a);
		film[i].xu=i;
	}
	for(int i=1;i<=m;i++){
		scanf("%d",&film[i].b);
	}
	sort(film+1,film+1+m,cmp);
	printf("%d",film[1].xu);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 400005;

int n, m;
int a[N], b[N], c[N], d[N + N / 2], e[N + N / 2], k[N];
int ans = 1, ans1, ans2;
inline void discrete(int x) {
    int t = 0;
    sort(d + 1, d + 1 + x);
    for(int i = 1; i <= x; ++i)
        if(i == 1 || d[i] != d[i - 1]) e[++t] = d[i];
    e[0] = t;
}
inline int query(int x) {

    int l = 1, r = e[0], mid;
    while(l < r) {
        mid = (l + r) >> 1;
        if(e[mid] >= x) r = mid;
        else l = mid + 1;
    }
    return l;
}

int main() {
    int t = 0;
    scanf("%d", &n);
    for(int i = 1; i <= n; ++i) {
        scanf("%d", a + i);
        d[++t] = a[i];
    }
    scanf("%d", &m);
    for(int i = 1; i <= m; ++i) {
        scanf("%d", b + i);
        d[++t] = b[i];
    }
    for(int i = 1; i <= m; ++i) {
        scanf("%d", c + i);
        d[++t] = c[i];
    }

    discrete(t);

    for(int i = 1; i <= n; ++i) k[query(a[i])]++;

    for(int i = 1; i <= m; ++i) {
        int x = k[query(b[i])], y = k[query(c[i])];
        if(x > ans1 || (x == ans1 && y > ans2)){
            ans = i;
            ans1 = x;
            ans2 = y;
        }
    }

    printf("%d", ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=700010;
int cnt,a[N],b[N],c[N],d[N],num,e[N];
void lsh(){
	sort(a+1,a+cnt+1);
	num=unique(a+1,a+cnt+1)-(a+1);
}
int cz(int x){
	return lower_bound(a+1,a+num+1,x)-a;
}
int main(){
	int n,m;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>b[i];
		a[++cnt]=b[i];
	}
	cin>>m;
	for(int i=1;i<=m;i++){
		cin>>c[i];
		a[++cnt]=c[i];
	}
	for(int i=1;i<=m;i++){
		cin>>d[i];
		a[++cnt]=d[i];
	}
	lsh();
	int ans1=0,ans2=0,ans3=1;
	for(int i=1;i<=n;i++){
		e[cz(b[i])]++;
	}
	for(int i=1;i<=m;i++){
		int ansx=e[cz(c[i])],ansy=e[cz(d[i])];
		if(ans1<ansx||(ansx==ans1&&ansy>ans2)){
			ans1=ansx;
			ans2=ansy;
			ans3=i;
	}
	cout<<ans3;
	return 0;
}


#pragma GCC optimize(2)
#include <iostream>
#include <queue>
#include <map>
#include <bitset>
#include <string>
#include <set>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <ctime>
#include <stack>
#include <cstdlib>
using namespace std;
#define maxn 200007
#define maxm 600007
#define maxl 1234
#define modn 998244353
#define scan(a) scanf("%d",&a)
#define scanl(a) scanf("%lld",&a)
#define scanl2(a,b) scanf("%lld%lld",&a,&b)
#define scres(a) scanf("%s",a)
#define scres2(a,b) scanf("%s%s",a,b)
#define scand(a) scanf("%lf",&a)
#define scan2(a,b) scanf("%d%d",&a,&b)
#define scand2(a,b) scanf("%lf%lf",&a,&b)
#define scan3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define scan4(a,b,c,d) scanf("%d%d%d%d",&a,&b,&c,&d)
#define scan5(a,b,c,d,e) scanf("%d%d%d%d%d",&a,&b,&c,&d,&e)
#define print(a) printf("%d\n",a);
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define mp      make_pair
#define pb      push_back
#define eb      emplace_back
#define mm(a,b) memset(a,b,sizeof a)
#define log2(n) (double)(log(n) / log(2.0))
#define _CRT_DISABLE_PERFCRIT_LOCKS
typedef long long ll;
typedef unsigned long long ull;
const int inf = 0x3f3f3f3f;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef map <int, int> mii;
typedef pair <int, int> pii;
typedef map <char, int> mci;
typedef map <char, char> mcc;
typedef pair <char, int> pci;
typedef unsigned long long ull;

const double eps = 1e-5;
const double PI = 2 * acos(0.0);
#define bll __int128

int cc, bb; char ch; int F() {
	while (ch = getchar(), (ch < 48 || ch> 57) && ch != '-'); ch == '-' ? cc = bb = 0 : (cc = ch - '0', bb = 1);
	while (ch = getchar(), ch > 47 && ch < 58)cc = (cc << 1) + (cc << 3) + (ch ^ 48); return bb ? cc : -cc;
}
void write(int x) {
	int y = 10, len = 1;
	while (y <= x) { y *= 10; len++; }
	while (len--) { y /= 10; putchar(x / y + 48); x %= y; }
}

int n, m, a[maxn], b[maxn], c[maxn], cinema[maxm], id = 0, ed, res[maxm];

int find(int f) {
	return lower_bound(cinema + 1, cinema + ed + 1, f) - cinema;
}
int main() {
	//ios::sync_with_stdio(0);
	//cin.tie(0);
	scan(n);
	for (int i = 1; i <= n; i++) {
		scan(a[i]);
		cinema[++id] = a[i];
	}
	scan(m);
	for (int i = 1; i <= m; i++) {
		scan(b[i]);
		cinema[++id] = b[i];
	}
	for (int i = 1; i <= m; i++) {
		scan(c[i]);
		cinema[++id] = c[i];
	}
	sort(cinema + 1, cinema + id + 1);
	ed = unique(cinema + 1, cinema + id + 1) - (cinema + 1);
	memset(res, 0, sizeof res);
	for (int i = 1; i <= n; i++)
		res[find(a[i])]++;
	int res0 = 1, res1 = 0, res2 = 0;
	for (int i = 1; i <= m; i++) {
		int resx = res[find(b[i])], resy = res[find(c[i])];
		if (resx > res1 || (resx == res1 && resy > res2)) {
			res0 = i;
			res1 = resx;
			res2 = resy;
		}
	}
	printf("%d\n", res0);
	return 0;
}


#include<iostream>
#include<map>
#include<algorithm>
#include<cstdio>
using namespace std;
inline int read()
{
    int ret=0,f=1;char ch=getchar();
    while(ch>'9'||ch<'0'){if(ch=='-')f=-f;ch=getchar();}
    while(ch>='0'&&ch<='9') ret=ret*10+ch-'0',ch=getchar();
    return ret*f;
}
inline int print(int x)
{
    if(x<0)
    {
        putchar('-');
        x=-x;
    }
    if(x>9)
        print(x/10);
    putchar(x%10+'0');
}
int a[200001],b[200001],c[200001],ans=1;
map<int,int> k;
int main()
{
	int n;
	n=read();
	int m;
	for(int i=1;i<=n;i++)
	  {
	  	a[i]=read();
	  }
	  m=read();
	for(int i=1;i<=m;i++)
	  {
	  	b[i]=read();
	  }
	  for(int i=1;i<=m;i++)
	    c[i]=read();
	for(int i=1;i<=m;i++)
	  {
	  	if(k[b[i]]>k[b[ans]])
	  	  ans=i;
	  	else if(k[b[i]]==k[b[ans]]&&k[c[i]]>k[c[ans]])
	  	       {
	  	       	ans=i;
	  	       }
	  }
	print(ans);
	  return 0;
}


#include<map>
#include<set>
#include<stack>
#include<deque>
#include<queue>
#include<cmath>
#include<bitset>
#include<vector>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<fstream>
#include<iostream>
#include<algorithm>
#define inf 2139062143
#define re register
#define ll long long
#define ull unsigned long long
#define lowbit(x) x&-x
#define Flj(i,a,b) for(int i=(a);i;i=(b))
#define Fze(i,a,b) for(int i=(a);i<(b);i++)
#define For(i,a,b) for(int i=(a);i<=(b);i++)
#define Fer(i,a,b) for(int i=(a);i>=(b);i--)
#define Fer1(i,a,b) for(int i=(a);i>b;i--)
#define Dfor(i,a,b,k) for(double i=(a);i<(b);i+=k)
#define Qmax priority_queue
#define Qmin priority_queue<int,vector<int>,greater<int> >
using namespace std;
int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
const int maxn=2e5+10;
int n,m,A,B;
vector<int> v;
int ans=1,maxx=-1,maxy=-1,a[maxn],b[maxn],c[maxn],k[maxn];
int getid(int x){return lower_bound(v.begin(),v.end(),x)-v.begin()+1;}
int main(){
	n=read();
	For(i,1,n) a[i]=read(),v.push_back(a[i]);
	m=read();
	For(i,1,m) b[i]=read(),v.push_back(b[i]);
	For(i,1,m) c[i]=read(),v.push_back(c[i]);
	stable_sort(v.begin(),v.end());
	v.erase(unique(v.begin(),v.end()),v.end());
	For(i,1,n) A=getid(a[i]),++k[A];
	For(i,1,m){
		A=getid(b[i]);B=getid(c[i]);
		if(k[A]>maxx){maxx=k[A];maxy=k[B];ans=i;}
		else if(k[A]==maxx&&k[B]>maxy){maxy=k[B];ans=i;}
	}
	printf("%d",ans);
}


#include<bits/stdc++.h>

using namespace std;

const int maxn=2e5+5;

struct Xu{
	int yin,zi;
}xu[maxn];

int n,m,most=-1,ans,x;

map<int,int>wen;

int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x;
		wen[x]++;
	}
	cin>>m;
	for(int i=1;i<=m;i++)cin>>xu[i].yin;
	for(int i=1;i<=m;i++)cin>>xu[i].zi;

	for(int i=1;i<=m;i++){
		if(most<wen[xu[i].yin]){
			most=wen[xu[i].yin];
			ans=i;
		}
		if(most==wen[xu[i].yin]){
			if(wen[xu[ans].zi]<wen[xu[i].zi])
			{ans=i;
				}
		}
	}cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
#define re register
typedef long long ll;
typedef unsigned long long ull;
inline int read(){//快速读入int型
    register int x=0,f=1;register char ch=getchar();
    while(!(ch>='0'&&ch<='9')&&ch!='-')ch=getchar();
    if(ch=='-')f=-1,ch=getchar();
    while(ch>='0'&&ch<='9'){
        x=(x<<3)+(x<<1)+(ch^'0');ch=getchar();
    }
    return x*f;
}
inline void fput(int x){//快速输出int型(无换行符)
    if(x<0)putchar('-'),x=-x;
    if(x>=10)fput(x/10);
    putchar(x%10+'0');
}
#define M 200005
int n,a[M],m,b[M],c[M],vis[M];
int main(){
	n=read();
	for(re int i=1;i<=n;i++)a[i]=b[i]=read();
	sort(b+1,b+n+1);
	for(re int i=1;i<=n;i++){
		vis[a[i]=lower_bound(b+1,b+n+1,a[i])-b]++;
	}
	m=read();
	for(re int i=1,x,y;i<=m;i++){
		x=y=read();
		x=lower_bound(b+1,b+n+1,x)-b;
		if(b[x]==y)c[i]=vis[x];
	}
	re int ans1=0,ans2=0,ansid=1;
	for(re int i=1,x,y;i<=m;i++){
		x=y=read();
		x=lower_bound(b+1,b+n+1,x)-b;
		if(c[i]>ans1){
			ans1=c[i];
			ans2=b[x]==y?vis[x]:0;
			ansid=i;
		}else if(b[x]==y&&c[i]==ans1&&vis[x]>ans2){
			ans2=vis[x];
			ansid=i;
		}
	}
	fput(ansid);
	return 0;
}


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

int n,m;
int a[200011];
struct movie
{
	int peiyin,zimu;
	int listen;//听得懂
	int look;//看得懂
	int bianhao;
}M[200011];

map<int,int>num;//语言i有多少人会

inline int comp(movie x,movie y)
{
	if(x.listen != y.listen)
		return x.listen>y.listen;
	if(x.look != y.look )
		return x.look>y.look;
	return x.bianhao<y.bianhao;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);

	cin>>n;//n个科学家
	for(register int i=1;i<=n;++i)
		cin>>a[i],	//第i个科学家说的语言
		++num[a[i]];
	cin>>m;//m场电影
	for(register int i=1;i<=m;++i)
		M[i].bianhao=i;
	for(register int i=1;i<=m;++i)
		cin>>M[i].peiyin,
		M[i].listen=num[M[i].peiyin];
	for(register int i=1;i<=m;++i)
		cin>>M[i].zimu,
		M[i].look=num[M[i].zimu];

	sort(M+1,M+n+1,comp);

	cout<<M[1].bianhao;

	return 0;
}


#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<map>
#include<vector>
#define INF 0x3f3f3f3f
#define N 200005
#define re register
#define Ii inline int
#define Il inline long long
#define Iv inline void
#define Ib inline bool
#define Id inline double
#define ll long long
#define Fill(a,b) memset(a,b,sizeof(a))
#define R(a,b,c) for(register int a=b;a<=c;++a)
#define nR(a,b,c) for(register int a=b;a>=c;--a)
#define Min(a,b) ((a)<(b)?(a):(b))
#define Max(a,b) ((a)>(b)?(a):(b))
#define Cmin(a,b) ((a)=(a)<(b)?(a):(b))
#define Cmax(a,b) ((a)=(a)>(b)?(a):(b))
#define D_e(x) printf("\n&__ %d __&\n",x)
#define D_e_Line printf("-----------------")
using namespace std;
/*
    The Code Below Is Used To Input Ans Output.
    Used Function:
        read()
        print()
*/
Ii read(){
    int s=0,f=1;char c;
    for(c=getchar();c>'9'||c<'0';c=getchar())if(c=='-')f=-1;
    while(c>='0'&&c<='9')s=s*10+(c^'0'),c=getchar();
    return s*f;
}
Iv print(ll x){
    if(x<0)putchar('-'),x=-x;
    if(x>9)print(x/10);
    putchar(x%10^'0');
}
/*
    The Code Below Is Used To Sort.
    Used Function:
        Count_Sort() //Error: Some Data Will Cause It Stop Working.
*/
/*
Iv Count_Sort(){
    int n=read(),*a=new int[n+1],*c=new int[n+1];
    R(i,0,n+1)a[i]=0,c[i]=0;
    int mx=0;
    R(i,1,n)
        a[i]=read(),Cmax(mx,a[i]);
    int *b=new int[mx+1];
    //D_e_Line;
    R(i,0,mx+1)b[i]=0;
    R(i,1,n)
        ++b[a[i]];
    R(i,1,mx)
        b[i]+=b[i-1];
    R(i,1,n)
        c[b[a[i]]--]=a[i];
    R(i,1,n)
        printf("%d\n",c[i]);
    delete[]a,
    delete[]b,
    delete[]c;
    return;
}
*/
int n,m,mov[2][N];
map<int,int>tot;//define tot as Language
Iv Input(){
	n=read();
	R(i,1,n)++tot[read()];
	m=read();
	R(i,1,m)mov[0][i]=read();
	R(i,1,m)mov[1][i]=read();
}
int main(){
	Input();
	int mov_best=1,mov_max=0,mov_sum=0;//define mov as Movie
	R(i,1,m){
		int a=tot[mov[0][i]],s=tot[mov[1][i]];
		if(a==mov_best&&s>mov_sum)
			mov_best=i,mov_sum=s;
		else if(a>mov_max)
			mov_best=i,mov_max=a,mov_sum=s;
	}
	print(mov_best);
	return 0;
}
/*
	Note:
		Using Descretization To Deal With The Big Data.
*/


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<ctime>
#include<cctype>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<map>
using namespace std;
#define MAX 200005
map<int, int>Map;
struct Node
{
	int au;
	int sub;
}node[MAX];

int n,temp,m;
int main()
{
	cin>>n;
	Map.clear();
	int temp;
	for(int i=1;i<=n;i++)
	{
		cin>>temp;
		Map[temp]++;
	}
	int m;
	cin>>m;
	for(int i=1;i<=m;i++)
	{
		cin>>node[i].au;
	}
	int Max1,Max2;
	Max1=Max2=0;
	int id=1;
	for(int i=1;i<=m;i++)
	{
		cin>>node[i].sub;
		if(Map[node[i].au]>Max1||(Map[node[i].au]==Max1&&Map[node[i].sub]>Max2))
		{
			Max1=Map[node[i].au];
			Max2=Map[node[i].sub];
			id=i;
		}
	}
	cout<<id<<endl;
	return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define ONLINE_JUDGE

const int N=1e5;
const int mod=1e9+7;

int i,j,n,cnt,p;

int32_t main()
{
	#ifndef ONLINE_JUDGE
       freopen("qns.txt","r",stdin);
       freopen("ans.txt","w",stdout);
    #endif
       IOS;

       bool prime[N+1];

memset(prime, true, sizeof(prime));
	   cin>>n;

    for ( p=2; p*p<=2*N; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (int i=p*p; i<=2*N; i += p)
                prime[i] = false;
        }
    }
	   i=2;
	   cnt=0;

//	   for(i=0;i<N;i++)
//	   cout<<prime[i]<<" ";

	   while(cnt<n)
	   {
	   	if(prime[i])
	   	{
	   		cnt++;
	   		cout<<i<<" ";
	   		i++;
		   }
		   else
		   i++;
	   }

	return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define ONLINE_JUDGE

const int N=1e5;
const int mod=1e9+7;
       bool prime[N];
int i,j,n,cnt,p;

int32_t main()
{
	#ifndef ONLINE_JUDGE
       freopen("qns.txt","r",stdin);
       freopen("ans.txt","w",stdout);
    #endif
       IOS;

memset(prime, true, sizeof(prime));
	   cin>>n;

    for ( p=2; p*p<=N; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (int i=p*p; i<=N; i += p)
                prime[i] = false;
        }
    }
	   i=2;
	   cnt=0;

//	   for(i=0;i<N;i++)
//	   cout<<prime[i]<<" ";

	   while(cnt<n)
	   {
	   	if(prime[i])
	   	{
	   		cnt++;
	   		cout<<i<<" ";
	   		i++;
		   }
		   else
		   i++;
	   }

	return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define ONLINE_JUDGE

const int N=1e14;
const int mod=1e9+7;
       bool prime[N];
int i,j,n,cnt,p;

int32_t main()
{
	#ifndef ONLINE_JUDGE
       freopen("qns.txt","r",stdin);
       freopen("ans.txt","w",stdout);
    #endif
       IOS;

memset(prime, true, sizeof(prime));
	   cin>>n;

    for ( p=2; p*p<=N; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (int i=p*p; i<=N; i += p)
                prime[i] = false;
        }
    }
	   i=2;
	   cnt=0;

//	   for(i=0;i<N;i++)
//	   cout<<prime[i]<<" ";

	   while(cnt<n)
	   {
	   	if(prime[i])
	   	{
	   		cnt++;
	   		cout<<i<<" ";
	   		i++;
		   }
		   else
		   i++;
	   }

	return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define ONLINE_JUDGE

const int N=1e5;
const int mod=1e9+7;
       bool prime[N];
int i,j,n,cnt,p,res;
vector<int> v;
int32_t main()
{
	#ifndef ONLINE_JUDGE
       freopen("qns.txt","r",stdin);
       freopen("ans.txt","w",stdout);
    #endif
       IOS;

	   cin>>n;
	   i=2;cnt=0;

	   v.push_back(i);
	   while(cnt<n-1)
	   {
	   	p=1;
	   	for(i=0;i<v.size();i++)
	   	{
		   p*=v[i];
	     }
	     res=p+1;
	     if(res<0)
	     res*=-1;
	   	v.push_back(res);
	   	cnt++;
	   }

   for(i=0;i<v.size();i++)
   cout<<v[i]<<" ";

	return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define ONLINE_JUDGE

const int N=1e5;
const int mod=1e9+7;

int i,j,n,cnt,p;

int32_t main()
{
	#ifndef ONLINE_JUDGE
       freopen("qns.txt","r",stdin);
       freopen("ans.txt","w",stdout);
    #endif
       IOS;

       bool prime[N+1];

memset(prime, true, sizeof(prime));
	   cin>>n;

    for ( p=2; p*p<=N; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (int i=p*p; i<=N; i += p)
                prime[i] = false;
        }
    }
	   i=2;
	   cnt=0;

//	   for(i=0;i<N;i++)
//	   cout<<prime[i]<<" ";

	   while(cnt<n)
	   {
	   	if(prime[i])
	   	{
	   		cnt++;
	   		cout<<i<<" ";
	   		i++;
		   }
		   else
		   i++;
	   }

	return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define ONLINE_JUDGE

const int N=1e5;
const int mod=1e9+7;
       bool prime[N];
int i,j,n,cnt,p,res;
vector<int> v;
int32_t main()
{
	#ifndef ONLINE_JUDGE
       freopen("qns.txt","r",stdin);
       freopen("ans.txt","w",stdout);
    #endif
       IOS;

	   cin>>n;
	   i=3*n;
	   for(j=0;j<n;j++)
	   {
	   cout<<i<<" ";
	   i++;
	    }

	return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define ONLINE_JUDGE

const int N=2e5;
const int mod=1e9+7;

int i,j,n,cnt,p;

int32_t main()
{
	#ifndef ONLINE_JUDGE
       freopen("qns.txt","r",stdin);
       freopen("ans.txt","w",stdout);
    #endif
       IOS;

       bool prime[N];

memset(prime, true, sizeof(prime));
	   cin>>n;

    for ( p=2; p*p<=N; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (int i=p*p; i<=N; i += p)
                prime[i] = false;
        }
    }
	   i=2;
	   cnt=0;

//	   for(i=0;i<N;i++)
//	   cout<<prime[i]<<" ";

	   while(cnt<n)
	   {
	   	if(prime[i])
	   	{
	   		cnt++;
	   		cout<<i<<" ";
	   		i++;
		   }
		   else
		   i++;
	   }

	return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define ONLINE_JUDGE

const int N=1e6;
const int mod=1e9+7;

int i,j,n,cnt,p;

int32_t main()
{
	#ifndef ONLINE_JUDGE
       freopen("qns.txt","r",stdin);
       freopen("ans.txt","w",stdout);
    #endif
       IOS;

       bool prime[N];

memset(prime, true, sizeof(prime));
	   cin>>n;

    for ( p=2; p*p<=N; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (int i=p*p; i<=N; i += p)
                prime[i] = false;
        }
    }
	   i=2;
	   cnt=0;

//	   for(i=0;i<N;i++)
//	   cout<<prime[i]<<" ";

	   while(cnt<n)
	   {
	   	if(prime[i])
	   	{
	   		cnt++;
	   		cout<<i<<" ";
	   		i++;
		   }
		   else
		   i++;
	   }

	return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define ONLINE_JUDGE

const int N=1e5;
const int mod=1e9+7;

int i,j,n,cnt,p;

int32_t main()
{
	#ifndef ONLINE_JUDGE
       freopen("qns.txt","r",stdin);
       freopen("ans.txt","w",stdout);
    #endif
       IOS;

       bool prime[2*N];

memset(prime, true, sizeof(prime));
	   cin>>n;

    for ( p=2; p*p<=2*N; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (int i=p*p; i<=2*N; i += p)
                prime[i] = false;
        }
    }
	   i=2;
	   cnt=0;

//	   for(i=0;i<N;i++)
//	   cout<<prime[i]<<" ";

	   while(cnt<n)
	   {
	   	if(prime[i])
	   	{
	   		cnt++;
	   		cout<<i<<" ";
	   		i++;
		   }
		   else
		   i++;
	   }

	return 0;
}


#include <bits/stdc++.h>

using namespace std;
void is_prime(int n,int &c)
{
    int count=0;
    for(int i=1; i<=sqrt(n); i++)
    {
        if (n%i==0)
        {
            count++;
        }
        if(count>2)
        {
            break;
        }
    }
    if(count==2)
    {
        cout<<n<<" ";
        c++;
    }

}
int main()
{

    int n,j=2,c=0;
    cin>>n;

    while(c<n)
    {
        is_prime(j,c);
        j++;

    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
void is_prime(int n,int &c)
{
    int count=0;
   // cout<<sqrt(n)<<endl;
    for(int i=1; i<=floor(sqrt(n)); i++)
    {
        if (n%i==0)
        {
            count++;
           // cout<<i<<endl;
        }
        if(count>1)
        {
            break;
        }
    }
    if(count==1)
    {
        cout<<n<<" ";
        c++;
    }

}
int main()
{

    int n,j=2,c=0;
    cin>>n;

    while(c<n)
    {
        is_prime(j,c);
        j++;

    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
void is_prime(int n,int &c)
{
    int count=0;
   // cout<<sqrt(n)<<endl;
    for(int i=1; i<=floor(sqrt(n)); i++)
    {
        if (n%i==0)
        {
            count++;
           // cout<<i<<endl;
        }
        if(count>2)
        {
            break;
        }
    }
    if(count==1)
    {
        cout<<n<<" ";
        c++;
    }

}
int main()
{

    int n,j=2,c=0;
    cin>>n;

    while(c<n)
    {
        is_prime(j,c);
        j++;

    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n,i=2,j=2,c=0;
    cin>>n;

    while(c<n)
    {
        i++;
        if(i>j&&i%j!=0)
        {
            cout<<i<<" ";
            j=i;
            c++;
        }

    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
void is_prime(int n,int &c)
{
    int count=0;
    for(int i=1; i<=n; i++)
    {
        if (n%i==0)
        {
            count++;
        }
        if(count>2)
        {
            break;
        }
    }
    if(count==2)
    {
        cout<<n<<" ";
        c++;
    }

}
int main()
{
    std::ios::sync_with_stdio(false);
    int n,j=2,c=0;
    cin>>n;

    while(c<n)
    {
        is_prime(j,c);
        j++;

    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
void is_prime(int n,int &c)
{
    int count=0;
    for(int i=1; i<=n; i++)
    {
        if (n%i==0)
        {
            count++;
        }
    }
    if(count==2)
    {
        cout<<n<<" ";
        c++;
    }

}
int main()
{
    int n,j=2,c=0;
    cin>>n;

    while(c<n)
    {
        is_prime(j,c);
        j++;

    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
void is_prime(int n,int &c)
{
    int count=0;
    for(int i=1; i<=n; i++)
    {
        if (n%i==0)
        {
            count++;
        }
        if(count>2)
        {
            break;
        }
    }
    if(count==2)
    {
        cout<<n<<" ";
        c++;
    }

}
int main()
{
    int n,j=2,c=0;
    cin>>n;

    while(c<n)
    {
        is_prime(j,c);
        j++;

    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
void is_prime(int n,int &c)
{
    int count=0;
   // cout<<sqrt(n)<<endl;
    for(int i=1; i<=(sqrt(n)); i++)
    {
        if (n%i==0)
        {
            count++;
           // cout<<i<<endl;
        }
        if(count>1)
        {
            break;
        }
    }
    if(count==1)
    {
        cout<<n<<" ";
        c++;
    }

}
int main()
{

    int n,j=2,c=0;
    cin>>n;

    while(c<n)
    {
        is_prime(j,c);
        j++;
        if(j%2==0)
        {
            j++;
        }
    }
    return 0;
}


#include<iostream>
#include<cmath>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int> a;
    a.push_back(2);
    a.push_back(3);
    int k=2;
    int count=2;
    if(n==1){
        cout<<2<<" ";
    }
    else if(n==2){
        cout<<2<<" "<<3;
    }
    else{
        cout<<2<<" "<<3<<" ";
        for(int i=5;i<10000001; i++){
            int flag=0;
            for(int j=2;j<=sqrt(i);j++){
                if(i%j==0){
                    flag=1;
                }
            }
            if(flag==0){
                a.push_back(i);
                cout<<i<<" ";
                count+=1;
                if(count==n){
                    break;
                }
            }
        }
    }

    //for(int i=0;i<n;i++){
     //   cout<<a[i]<<" ";
   // }
    return 0;
}


#include<iostream>
#include<cmath>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int> a;
    a.push_back(2);
    a.push_back(3);
    int k=2;
    int count=2;
    cout<<2<<" "<<3<<" ";

        for(int i=5;i<10000001; i++){
            int flag=0;
            for(int j=2;j<=sqrt(i);j++){
                if(i%j==0){
                    flag=1;
                }
            }
            if(flag==0){
                a.push_back(i);
                cout<<i<<" ";
                count+=1;
                if(count==n){
                    break;
                }
            }
        }

    //for(int i=0;i<n;i++){
     //   cout<<a[i]<<" ";
   // }
    return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin>>n;
    int a[100001]={0};
    a[0]=2;
    a[1]=3;
    int k=2;

        for(int i=5;i<100001; i++){
            int flag=0;
            for(int j=2;j<=sqrt(i);j++){
                if(i%j==0){
                    flag=1;
                }
            }
            if(flag==0){
                a[k++]=i;
            }
        }

    for(int i=0;i<n;i++){
        cout<<a[i]<<" ";
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    int x=3000001;
    for(int i=0;i<n;i++){
        cout<<x<<" ";
        x+=1;
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    int x=7000001;
    for(int i=0;i<n;i++){
        cout<<x<<" ";
        x+=1;
    }
    return 0;
}


#include <iostream>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <stack>
#include <sstream>
#include <queue>
#include <iomanip>
#include <windows.h>
#include <cstdio>
#include <list>
#define ull unsigned long long
#define ll long long
#define ld long double
#define pi 3.1415926536
#define lp(i,n) for(ll i=0;i<n;i++)
#define lp1(i,n) for(ll i=1;i<=n;i++)
#define pl(i,n) for(ll i=n-1;i>=0;i--)
#define w while
#define re return
// Hard Training :D
// hossam yehia //
using namespace std;
ll lcm(ll a, ll b){
	ll maxi = max(a, b);
	w((maxi%a) || (maxi%b))
		maxi++;
	re maxi;
}
ll arr[100000];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n, k(10000000), c(0);
	cin >> n;
	w(n--)
		arr[c]=k,k--,c++;
	reverse(arr, arr + c);
	lp(i, c)
		cout << arr[i] << " ";
	system("pause");
	re 0;
}


#include <iostream>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <stack>
#include <sstream>
#include <queue>
#include <iomanip>
#include <windows.h>
#include <cstdio>
#include <list>
#define ull unsigned long long
#define ll long long
#define ld long double
#define pi 3.1415926536
#define lp(i,n) for(ll i=0;i<n;i++)
#define lp1(i,n) for(ll i=1;i<=n;i++)
#define pl(i,n) for(ll i=n-1;i>=0;i--)
#define w while
#define re return
// Hard Training :D
// hossam yehia //
using namespace std;
ll lcm(ll a, ll b){
	ll maxi = max(a, b);
	w((maxi%a) || (maxi%b))
		maxi++;
	re maxi;
}
ll arr[100000];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n, k(10000000), c(0);
	cin >> n;
	w(n--)
		arr[c]=k,k--,c++;
	sort(arr, arr + c);
	lp(i, c)
		cout << arr[i] << " ";
	//system("pause");
	re 0;
}


#include <iostream>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <stack>
#include <sstream>
#include <queue>
#include <iomanip>
#include <windows.h>
#include <cstdio>
#include <list>
#define ull unsigned long long
#define ll long long
#define ld long double
#define pi 3.1415926536
#define lp(i,n) for(ll i=0;i<n;i++)
#define lp1(i,n) for(ll i=1;i<=n;i++)
#define pl(i,n) for(ll i=n-1;i>=0;i--)
#define w while
#define re return
// Hard Training :D
// hossam yehia //
using namespace std;
ll lcm(ll a, ll b){
	ll maxi = max(a, b);
	w((maxi%a) || (maxi%b))
		maxi++;
	re maxi;
}
ll arr[100000];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n, k(10000000), c(0);
	cin >> n;
	w(n--)
		arr[c]=k,k--,c++;
	reverse(arr, arr + c);
	lp(i, c)
		cout << arr[i] << " ";
	//system("pause");
	re 0;
}


#include <iostream>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <stack>
#include <sstream>
#include <queue>
#include <iomanip>
#include <windows.h>
#include <cstdio>
#include <list>
#define ull unsigned long long
#define ll long long
#define ld long double
#define pi 3.1415926536
#define lp(i,n) for(ll i=0;i<n;i++)
#define lp1(i,n) for(ll i=1;i<=n;i++)
#define pl(i,n) for(ll i=n-1;i>=0;i--)
#define w while
#define re return
// Hard Training :D
// hossam yehia //
using namespace std;
ll lcm(ll a, ll b){
	ll maxi = max(a, b);
	w((maxi%a) || (maxi%b))
		maxi++;
	re maxi;
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n, k(10000000), c(0);
	cin >> n;
	ll *arr = new ll(n);
	w(n--)
		arr[c]=k,k--,c++;
	reverse(arr, arr + c);
	lp(i, c)
		cout << arr[i] << " ";
	//system("pause");
	re 0;
}


#include <iostream>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <stack>
#include <sstream>
#include <queue>
#include <iomanip>
#include <windows.h>
#include <cstdio>
#include <list>
#define ull unsigned long long
#define ll long long
#define ld long double
#define pi 3.1415926536
#define lp(i,n) for(ll i=0;i<n;i++)
#define lp1(i,n) for(ll i=1;i<=n;i++)
#define pl(i,n) for(ll i=n-1;i>=0;i--)
#define w while
#define re return
// Hard Training :D
// hossam yehia //
using namespace std;
ll lcm(ll a, ll b){
	ll maxi = max(a, b);
	w((maxi%a) || (maxi%b))
		maxi++;
	re maxi;
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n, k(10000000);
	cin >> n;
	w(n--)
		cout << k << " ", k--;
	//system("pause");
	re 0;
}


#include <iostream>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <stack>
#include <sstream>
#include <queue>
#include <iomanip>
#include <windows.h>
#include <cstdio>
#include <list>
#define ull unsigned long long
#define ll long long
#define ld long double
#define pi 3.1415926536
#define lp(i,n) for(ll i=0;i<n;i++)
#define lp1(i,n) for(ll i=1;i<=n;i++)
#define pl(i,n) for(ll i=n-1;i>=0;i--)
#define w while
#define re return
// Hard Training :D
// hossam yehia //
using namespace std;
ll lcm(ll a, ll b){
	ll maxi = max(a, b);
	w((maxi%a) || (maxi%b))
		maxi++;
	re maxi;
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n, k(2);
	cin >> n;
	w(n--)
		cout << k << " ", k++;
	//system("pause");
	re 0;
}


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

int main()
{
int n,i,j,k;
cin>>n;
k=100001;
bool prime[k];
memset(prime,true,sizeof(prime));
prime[1]=false;
for(i=2;i*i<=k;i++)
{
	if(prime[i]==true)
	{
		for(j=i*i;j<=k;j+=i)
		{
			prime[j]=false;
		}
	}
}
i=2;
j=1;
while(j<=n)
{
	if(prime[i]==true)
	{
		cout<<i<<" ";
		j++;
	}
i++;
}
return 0;
}


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

int main()
{
int n,i;
cin>>n;
for(i=0;i<n;i++)
{
	cout<<i+n*10<<" ";
}
return 0;
}


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

int main()
{
int n,i,j,k;
cin>>n;
k=105000;
bool prime[k];
memset(prime,true,sizeof(prime));
prime[1]=false;
for(i=2;i*i<=k;i++)
{
	if(prime[i]==true)
	{
		for(j=i*i;j<=k;j+=i)
		{
			prime[j]=false;
		}
	}
}
i=2;
j=1;
while(j<=n)
{
	if(prime[i]==true)
	{
		cout<<i<<" ";
		j++;
	}
i++;
}
return 0;
}


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

int main()
{
int n,i,j,k;
cin>>n;
k=105000;
bool prime[k];
memset(prime,true,sizeof(prime));
prime[1]=false;
for(i=2;i*i<=k;i++)
{
	if(prime[i]==true)
	{
		for(j=i*i;j<=k;j+=i)
		{
			prime[j]=false;
		}
	}
}
j=0;
for(i=1;i<=k;i++)
{
	if(prime[i])
	{
		j++;
		cout<<i<<" ";
	}
	if(j>=n)
	{
		break;
	}
}

return 0;
}


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

int main()
{
int n,i,j,k;
cin>>n;
k=1000000;
bool prime[k];
memset(prime,true,sizeof(prime));
prime[1]=false;
for(i=2;i*i<=k;i++)
{
	if(prime[i]==true)
	{
		for(j=i*i;j<=k;j+=i)
		{
			prime[j]=false;
		}
	}
}
i=2;
j=1;
while(j<=n)
{
	if(prime[i]==true)
	{
		cout<<i<<" ";
		j++;
	}
i++;
}
return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n, a[100000] ;
	bool found ;
	cin>>n ;

	a[0] = 2 ;

	for( int i = 1 ; i<n ; i++ )
	{
		int j ;
		for( j = a[i-1]+1 ; ; j++ )
		{
			found = 1 ;
			for( int k = 0 ; k<i ; k++ )
			{
				if( j%a[k]==0 )	found = 0 ;
			}
			if( found )	break ;
		}
		a[i] = j ;
	}

	for( int i = 0; i<n; i++ )
	{
		cout<<a[i]<<" " ;
	}

	return 0 ;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n, a[100000] ;
	bool found ;
	cin>>n ;

	a[0] = 2 ;

	for( int i = 1 ; i<n ; i++ )
	{
		int j ;
		for( j = a[i-1]+1 ; ; j++ )
		{
			found = 1 ;
			for( int k = 0 ; k<j/2 ; k++ )
			{
				if( j%a[k]==0 )	found = 0 ;
			}
			if( found )	break ;
		}
		a[i] = j ;
	}

	for( int i = 0; i<n; i++ )
	{
		cout<<a[i]<<" " ;
	}

	return 0 ;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n, a[100000] ;
	bool found ;
	cin>>n ;

	a[0] = 2 ;

	for( int i = 1 ; i<n ; i++ )
	{
		int j ;
		for( j = a[i-1]+1 ; ; j++ )
		{
			found = 1 ;
			for( int k = 0 ; k<i/2 ; k++ )
			{
				if( j%a[k]==0 )	found = 0 ;
			}
			if( found )	break ;
		}
		a[i] = j ;
	}

	for( int i = 0; i<n; i++ )
	{
		cout<<a[i]<<" " ;
	}

	return 0 ;
}


#include <bits/stdc++.h>

using namespace std;

bool isPrime( int num )
{
	int rt = sqrt( num ) ;
	for( int i = 2 ; i<=rt ; i++ )
	{
		if( num%i==0 )	return false ;
	}
	return true ;
}

int main()
{
	int n, printed = 1, lastPrinted=2 ;
	cin>>n ;

	cout<<2<<" ";

	while( printed<n )
	{
		for( int i = lastPrinted+1 ; ; i++ )
		{
			if( isPrime( i ) )
			{
				cout<<i<<" " ;
				lastPrinted = i ;
				printed++ ;
				break ;
			}
		}
	}

	return 0 ;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n, a[100000] ;
	bool found ;
	cin>>n ;

	a[0] = 2 ;

	for( int i = 1 ; i<n ; i++ )
	{
		int j ;
		for( j = a[i-1]+1 ; ; j++ )
		{
			found = 1 ;
			for( int k = 0 ; k<=j/2 ; k++ )
			{
				if( j%a[k]==0 )	found = 0 ;
			}
			if( found )	break ;
		}
		a[i] = j ;
	}

	for( int i = 0; i<n; i++ )
	{
		cout<<a[i]<<" " ;
	}

	return 0 ;
}


#include <bits/stdc++.h>
#define sfl(n) scanf("%I64d",&n);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
double PI=3.14159265358979323843;
void Time(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
void print(int n){
    if(n==0){
        return ;
    }
    print(n-1);
    cout<<"Hello world"<<endl;
}
bool PN (ll x){
	for(int i=2;i<=sqrt(x);i++){
	    if (x%i==0) {
			return false;
		}
	}
	return true;
}
int main(){

    Time();
    ll n; cin>>n;
    ll num=2;
    while(n!=0){
        if(PN(num)==true){
            cout<<num<<" ";
            n--;
        }
        if(num==2){num++;}
        else{num+=2;}
    }

    return 0;
}


#include <bits/stdc++.h>
#define sfl(n) scanf("%I64d",&n);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
double PI=3.14159265358979323843;
void Time(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
void print(int n){
    if(n==0){
        return ;
    }
    print(n-1);
    cout<<"Hello world"<<endl;
}
bool PN (ll x){
	for(int i=2;i<=sqrt(x);i++){
	    if (x%i==0) {
			return false;
		}
	}
	return true;
}
int main(){

    Time();
    ll n; cin>>n;
    ll num=2,c=0;
    while(true){
        if(c==n)
            break;
        bool ans;
        ans=PN(num);
        if(ans){
            cout<<num<<" ";
            c++;
            num++;
        }
        else{num++;}
    }

    return 0;
}


#include <bits/stdc++.h>
#define sfl(n) scanf("%I64d",&n);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
double PI=3.14159265358979323843;
void Time(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
void print(int n){
    if(n==0){
        return ;
    }
    print(n-1);
    cout<<"Hello world"<<endl;
}
bool PN (ll x){
	for(int i=2;i<=sqrt(x);i++){
	    if (x%i==0) {
			return false;
		}
	}
	return true;
}
int main(){

    Time();
    int n; cin>>n; for(ll i=1000000; i<1000000+n; i++){cout<<i<<" ";}
    return 0;
}


#include <bits/stdc++.h>
#define sfl(n) scanf("%I64d",&n);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
double PI=3.14159265358979323843;
void Time(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
void print(int n){
    if(n==0){
        return ;
    }
    print(n-1);
    cout<<"Hello world"<<endl;
}
bool PN (ll x){
	for(int i=2;i<=sqrt(x);i++){
	    if (x%i==0) {
			return false;
		}
	}
	return true;
}
int main(){

    Time();
    ll n; cin>>n;
    ll num=2;
    while(n!=0){
        if(PN(num)==true){
            cout<<num<<" ";
            n--;
        }
        num++;
    }

    return 0;
}


#include <bits/stdc++.h>
#define sfl(n) scanf("%I64d",&n);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
double PI=3.14159265358979323843;
void Time(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
void print(int n){
    if(n==0){
        return ;
    }
    print(n-1);
    cout<<"Hello world"<<endl;
}
bool PN (ll x){
	for(int i=2;i<=sqrt(x);i++){
	    if (x%i==0) {
			return false;
		}
	}
	return true;
}
int main(){

    Time();
    int n; cin>>n;
    int num=2,c=0;
    while(true){
        if(c==n){break;}
        bool ans=PN(num);
        if(ans){
            cout<<num<<" ";
            c++;
            num++;
        }else{num++;}
    }

    return 0;
}


////██╗ ██████╗ ██╗    ██████╗  ██████╗  ██╗ █████╗
////██║██╔═══██╗██║    ╚════██╗██╔═████╗███║██╔══██╗
////██║██║   ██║██║     █████╔╝██║██╔██║╚██║╚██████║
////██║██║   ██║██║    ██╔═══╝ ████╔╝██║ ██║ ╚═══██║
////██║╚██████╔╝██║    ███████╗╚██████╔╝ ██║ █████╔╝
////╚═╝ ╚═════╝ ╚═╝    ╚══════╝ ╚═════╝  ╚═╝ ╚════╝

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define fr first
#define sc second
#define mlojins cout.tie(NULL);
#define bzbz cin.tie(NULL);
#define CODER ios_base::sync_with_stdio(0)  ;
#define p_b pop_back
#define p_f pop_front

using namespace std ;

const ll N = 1e6 + 1;

map <ll , ll> mp , pm ;
deque <ll> v , vc , ve ;
deque <char> p , pe ;
deque <string> st ;
ll a , b , c , d , e , f , cnt , ans , r , n , l;
float q , t , cnt1;
string g , h , w , o , z , m , s ;
char y , u ;
vector<pair < ll , ll > > pr , rp;
int main ()
{
    bzbz
    mlojins
    CODER
    /*freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);*/
    cin >> a ;
    cnt = 0 ;
    b = 1;
    while (cnt != a)
    {
        b ++ ;
        ans = 0 ;
        for (int i = 1 ; i <= b ; i ++ )
        {
            if (b % i == 0)
                ans ++ ;
        }
        if (ans == 2)
        {
            v.pb(b) , cnt ++ ;
        }
    }
    for (int i = 0 ; i < a ; i ++ )
        cout << v[i] << " ";
}
///Mmavl studios
///Eco students
///7c is the best


////██╗ ██████╗ ██╗    ██████╗  ██████╗  ██╗ █████╗
////██║██╔═══██╗██║    ╚════██╗██╔═████╗███║██╔══██╗
////██║██║   ██║██║     █████╔╝██║██╔██║╚██║╚██████║
////██║██║   ██║██║    ██╔═══╝ ████╔╝██║ ██║ ╚═══██║
////██║╚██████╔╝██║    ███████╗╚██████╔╝ ██║ █████╔╝
////╚═╝ ╚═════╝ ╚═╝    ╚══════╝ ╚═════╝  ╚═╝ ╚════╝

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define fr first
#define sc second
#define mlojins cout.tie(NULL);
#define bzbz cin.tie(NULL);
#define CODER ios_base::sync_with_stdio(0)  ;
#define p_b pop_back
#define p_f pop_front

using namespace std ;

const ll N = 1e6 + 1;

map <ll , ll> mp , pm ;
deque <ll> v , vc , ve ;
deque <char> p , pe ;
deque <string> st ;
ll a , b , c , d , e , f , cnt , ans , r , n , l;
float q , t , cnt1;
string g , h , w , o , z , m , s ;
char y , u ;
vector<pair < ll , ll > > pr , rp;
int main ()
{
    bzbz
    mlojins
    CODER
    /*freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);*/
    cin >> a ;
    v[0] = 2 ;
    v[1] = 3 ;
    for (int i = 2 ; i < a ; i ++ )
        v[i] = v[i-1] + v[i-2] ;
    for (int i = 0 ; i < a ; i ++ )
        cout << v[i] << " ";
}
///Mmavl studios
///Eco students
///7c is the best


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n, k, i = 0, flag, j;
    cin >> n;
    for(j = 2; j <= 10000000; j++)
    {
        flag = 0;
        if(i == n)break;
        for(k = 2; k <= sqrt(j); k++)
        {
            if(j%k==0)
            {
                flag = 1;
                break;
            }
        }
        if(flag == 0)
        {
            cout << j <<" ";
            i++;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long bi = 10000010;
int main()
{
    long long n, i = 0, j;
    bool ara[10000010];
    memset(ara, true, sizeof(ara));
    cin >> n;
    for(i = 2; i <= bi; i++)
    {
        if(n < 1)break;
        if(ara[i] == true)
        {
            if(n > 1)
                cout << i << " ";
            else if(n==1)
                cout << i;
            for(j = i*2; j <= bi; j+=i)
            {
                ara[j] = false;
            }
            --n;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long bi = 1000000;
int main()
{
    long long n, i = 0, j;
    bool ara[1000050];
    memset(ara, true, sizeof(ara));
    cin >> n;
    for(i = 2; i*i <= bi; i++)
    {
        if(n < 1)break;
        if(ara[i] == true)
        {
            cout << i << " ";
            for(j = i*2; j <= bi; j+=i)
            {
                ara[j] = false;
            }
            --n;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long bi = 1000000;
int main()
{
    long long n, i = 0, j;
    bool ara[1000050];
    memset(ara, true, sizeof(ara));
    cin >> n;
    for(i = 2; i <= bi; i++)
    {
        if(n < 1)break;
        if(ara[i] == true)
        {
            cout << i << " ";
            for(j = i*2; j <= bi; j+=i)
            {
                ara[j] = false;
            }
            --n;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long bi = 10000000;
int main()
{
    long long n, i = 0, j;
    bool ara[10000050];
    memset(ara, true, sizeof(ara));
    cin >> n;
    for(i = 2; i*i <= bi; i++)
    {
        if(n < 1)break;
        if(ara[i] == true)
        {
            cout << i << " ";
            for(j = i*2; j <= bi; j+=i)
            {
                ara[j] = false;
            }
            n--;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long bi = 1000000;
int main()
{
    long long n, i = 0, j;
    bool ara[1000050];
    memset(ara, true, sizeof(ara));
    cin >> n;
    for(i = 2; i*i <= bi; i++)
    {
        if(n < 1)break;
        if(ara[i] == true)
        {
            cout << i << " ";
            for(j = i*2; j <= bi; j+=i)
            {
                ara[j] = false;
            }
            n--;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long bi = 10000000;
int main()
{
    long long n, i = 0, j;
    bool ara[1000050];
    memset(ara, true, sizeof(ara));
    cin >> n;
    for(i = 2; i <= bi; i++)
    {
        if(n < 1)break;
        if(ara[i] == true)
        {
            if(n > 1)
                cout << i << " ";
            else if(n==1)
                cout << i;
            for(j = i*2; j <= bi; j+=i)
            {
                ara[j] = false;
            }
            --n;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long bi = 1000000;
int main()
{
    long long n, i = 0, j;
    bool ara[1000050];
    memset(ara, true, sizeof(ara));
    cin >> n;
    for(i = 2; i <= bi; i++)
    {
        if(n < 1)break;
        if(ara[i] == true)
        {
            if(n > 1)
                cout << i << " ";
            else if(n==1)
                cout << i;
            for(j = i*2; j <= bi; j+=i)
            {
                ara[j] = false;
            }
            --n;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long bi = 1000000;
int main()
{
    long long n, i = 0, j;
    bool ara[1000050];
    memset(ara, true, sizeof(ara));
    cin >> n;
    for(i = 2; i < bi; i++)
    {
        if(n < 1)break;
        if(ara[i] == true)
        {
            cout << i << " ";
            for(j = i*2; j < bi; j+=i)
            {
                ara[j] = false;
            }
            --n;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n, k, i = 0, flag, j;
    cin >> n;
    for(j = 2; j <= 10000000; j++)
    {
        flag = 0;
        if(i == n)break;
        for(k = 2; k <= sqrt(j); k++)
        {
            if(k % 2 == 0)break;
            if(j%k==0)
            {
                flag = 1;
                break;
            }
        }
        if(flag == 0)
        {
            cout << j <<" ";
            i++;
        }
    }
    return 0;
}


/******************************************
          Mobarak Hosen Shakil
        ICE, Islamic University
     ID: mhiceiuk(all), 29698(LOJ)
   E-mail: mhiceiuk @ (Gmail/Yahoo/FB)
 Blog: https://iuconvergent.wordpress.com
*******************************************/

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

#define IOS             ios_base::sync_with_stdio(0);cin.tie(0)
#define LL              long long int
#define ULL             unsigned LL
#define Read(File)      freopen(File, "r", stdin)
#define Write(File)     freopen(File, "w", stdout)
#define FOR(a, b)       for(int i=a; i<b; i++)
#define Rep(b, a)       for(int j=b; j>=a; j--)
#define For(k, a, b)    for(k=a; k<b; k++)
#define PII             pair<int, int>

const int inf = 1<<30;
const LL INF  = 1e18;
const int MOD = 1e9+7;
const int MAXN = 300005;

/*** Custom comparision ***/
bool Compare(const PII &x, const PII &y)
{
    if(x.first == y.first)
    {
        return x.second>y.second;
    }
    return x.first<y.first;
}

vector<int> prime;
bool chk[10000007];

void Prime_Generate(int n)
{

    memset(chk, 0, sizeof chk);
    prime.push_back(2);

    for(int i=3; i*i<=n; i+=2)
    {
        if(!chk[i])
        {
            prime.push_back(i);

            for(int j=i*i; j<=n; j+=i)
                chk[j]=1;
        }
    }

    for(int i=3; i<=n; i+=2)
    {
        if(!chk[i]) prime.push_back(i);
    }

}

int main()
{
    int n;
    scanf("%d", &n);
    Prime_Generate(1500000);

    for(int i=0; i<n; i++)
    {
        printf("%d ", prime[i]);
    }

    return 0;
}


/******************************************
          Mobarak Hosen Shakil
        ICE, Islamic University
     ID: mhiceiuk(all), 29698(LOJ)
   E-mail: mhiceiuk @ (Gmail/Yahoo/FB)
 Blog: https://iuconvergent.wordpress.com
*******************************************/

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

#define IOS             ios_base::sync_with_stdio(0);cin.tie(0)
#define LL              long long int
#define ULL             unsigned LL
#define Read(File)      freopen(File, "r", stdin)
#define Write(File)     freopen(File, "w", stdout)
#define FOR(a, b)       for(int i=a; i<b; i++)
#define Rep(b, a)       for(int j=b; j>=a; j--)
#define For(k, a, b)    for(k=a; k<b; k++)
#define PII             pair<int, int>

const int inf = 1<<30;
const LL INF  = 1e18;
const int MOD = 1e9+7;
const int MAXN = 300005;

/*** Custom comparision ***/
bool Compare(const PII &x, const PII &y)
{
    if(x.first == y.first)
    {
        return x.second>y.second;
    }
    return x.first<y.first;
}

int main()
{
    int n;
    scanf("%d", &n);
  ///  Prime_Generate(1500000);
    int ed = 2*n - 1;

    while(n<=ed)
    {
        printf("%d ", n);
        n++;
    }

    return 0;
}


/******************************************
          Mobarak Hosen Shakil
        ICE, Islamic University
     ID: mhiceiuk(all), 29698(LOJ)
   E-mail: mhiceiuk @ (Gmail/Yahoo/FB)
 Blog: https://iuconvergent.wordpress.com
*******************************************/

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

#define IOS             ios_base::sync_with_stdio(0);cin.tie(0)
#define LL              long long int
#define ULL             unsigned LL
#define Read(File)      freopen(File, "r", stdin)
#define Write(File)     freopen(File, "w", stdout)
#define FOR(a, b)       for(int i=a; i<b; i++)
#define Rep(b, a)       for(int j=b; j>=a; j--)
#define For(k, a, b)    for(k=a; k<b; k++)
#define PII             pair<int, int>

const int inf = 1<<30;
const LL INF  = 1e18;
const int MOD = 1e9+7;
const int MAXN = 300005;

/*** Custom comparision ***/
bool Compare(const PII &x, const PII &y)
{
    if(x.first == y.first)
    {
        return x.second>y.second;
    }
    return x.first<y.first;
}

vector<int> prime;
bool chk[10000007];

void Prime_Generate(int n)
{

    memset(chk, 0, sizeof chk);
    prime.push_back(2);

    for(int i=3; i*i<=n; i+=2)
    {
        if(!chk[i])
        {
            chk[i] = 1;
            prime.push_back(i);
            for(int j=i*i; j<=n; j+=i)
                chk[j]=1;
        }
    }

    for(int i=3; i<=n; i+=2)
    {
        if(!chk[i]) prime.push_back(i);
    }

}

int main()
{
    int n;
    scanf("%d", &n);
    Prime_Generate(1500000);
    for(int i=0; i<n; i++)
    {
        printf("%d ", prime[i]);
    }

    return 0;
}


/******************************************
          Mobarak Hosen Shakil
        ICE, Islamic University
     ID: mhiceiuk(all), 29698(LOJ)
   E-mail: mhiceiuk @ (Gmail/Yahoo/FB)
 Blog: https://iuconvergent.wordpress.com
*******************************************/

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

#define IOS             ios_base::sync_with_stdio(0);cin.tie(0)
#define LL              long long int
#define ULL             unsigned LL
#define Read(File)      freopen(File, "r", stdin)
#define Write(File)     freopen(File, "w", stdout)
#define FOR(a, b)       for(int i=a; i<b; i++)
#define Rep(b, a)       for(int j=b; j>=a; j--)
#define For(k, a, b)    for(k=a; k<b; k++)
#define PII             pair<int, int>

const int inf = 1<<30;
const LL INF  = 1e18;
const int MOD = 1e9+7;
const int MAXN = 300005;

/*** Custom comparision ***/
bool Compare(const PII &x, const PII &y)
{
    if(x.first == y.first)
    {
        return x.second>y.second;
    }
    return x.first<y.first;
}

vector<int> prime;
bool chk[1500000];

void Prime_Generate(int n)
{

    memset(chk, 0, sizeof chk);
    prime.push_back(2);

    for(int i=3; i*i<=n; i+=2)
    {
        if(!chk[i])
        {
            chk[i] = 1;
            prime.push_back(i);
            for(int j=i*i; j<=n; j+=i)
                chk[j]=1;
        }
    }

    for(int i=3; i<=n; i+=2)
    {
        if(!chk[i]) prime.push_back(i);
    }

}

int main()
{
    int n;
    scanf("%d", &n);
    Prime_Generate(1500000);
    for(int i=0; i<n; i++)
    {
        printf("%d ", prime[i]);
    }

    return 0;
}


/******************************************
          Mobarak Hosen Shakil
        ICE, Islamic University
     ID: mhiceiuk(all), 29698(LOJ)
   E-mail: mhiceiuk @ (Gmail/Yahoo/FB)
 Blog: https://iuconvergent.wordpress.com
*******************************************/

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

#define IOS             ios_base::sync_with_stdio(0);cin.tie(0)
#define LL              long long int
#define ULL             unsigned LL
#define Read(File)      freopen(File, "r", stdin)
#define Write(File)     freopen(File, "w", stdout)
#define FOR(a, b)       for(int i=a; i<b; i++)
#define Rep(b, a)       for(int j=b; j>=a; j--)
#define For(k, a, b)    for(k=a; k<b; k++)
#define PII             pair<int, int>

const int inf = 1<<30;
const LL INF  = 1e18;
const int MOD = 1e9+7;
const int MAXN = 300005;

/*** Custom comparision ***/
bool Compare(const PII &x, const PII &y)
{
    if(x.first == y.first)
    {
        return x.second>y.second;
    }
    return x.first<y.first;
}

int main()
{
    int n;
    scanf("%d", &n);
  ///  Prime_Generate(1500000);
      int st = n*3;
      int ed = n*4;

      FOR(st, ed)
      {
          printf("%d ", i);
      }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int N=1e6+5;
bool is_prime[N];
vector<long long> v;

void fun(){
    for(long long i=2;i<N;i++)
    {
        if(is_prime[i]==0)
        {
            for(long long j=i*i;j<N;j+=i)
            {
                is_prime[j]=1;
            }
            v.push_back(i);
        }
    }
}
int main()
{
    int n,x;
    fun();
    cin>>n;
    vector<long long>ans;
    for(long long i=0;i<v.size();i++)
    {
        for(long long j=i;j<v.size();j++)
        {
            x=v[i]*v[j];
            ans.push_back(x);
        }
        if(ans.size()>n) break;
    }
    sort(ans.begin(),ans.end());
    for(long long i=0;i<n;i++)
    {
        cout<<ans[i]<<' ';
    }
    cout<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,x;
    cin>>n;
    n--;
    vector<int>v(1);
    v[0]=4;
    while(n--)
    {
        x=v[v.size()-1]+1;
        for(int i=0;i<v.size();i++)
        {
            if(x%v[i]==0)
            {
                x++;
                i=0;
            }
        }
        v.push_back(x);
    }

    for(int i=0;i<v.size();i++)
    {
        if(i) cout<<' '<<v[i];
        else cout<<v[i];
    }
    cout<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int N=1e5+5;
bool is_prime[N];
vector<int> v;

void fun(){
    for(long long i=2;i<N;i++)
    {
        if(is_prime[i]==0)
        {
            for(long long j=i*i;j<N;j+=i)
            {
                is_prime[j]=1;
            }
            v.push_back(i);
        }
    }
}
int main()
{
    int n,x;
    fun();
    cin>>n;
    vector<long long>ans;
    for(long long i=0;i<v.size();i++)
    {
        for(long long j=i;j<v.size();j++)
        {
            x=v[i]*v[j];
            ans.push_back(x);
        }
        if(ans.size()>n) break;
    }
    for(long long i=0;i<n;i++)
    {
        cout<<ans[i]<<' ';
    }
    cout<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int N=1e6+5;
bool is_prime[N];
vector<long long> v;

void fun(){
    for(long long i=2;i<N;i++)
    {
        if(is_prime[i]==0)
        {
            for(long long j=i*i;j<N;j+=i)
            {
                is_prime[j]=1;
            }
            v.push_back(i);
        }
    }
}
int main()
{
    int n,x;
    fun();
    cin>>n;
    vector<long long>ans;
    for(long long i=0;i<v.size();i++)
    {
        for(long long j=i+1;j<v.size();j++)
        {
            x=v[i]*v[j];
            ans.push_back(x);
        }
        if(ans.size()>n) break;
    }
    sort(ans.begin(),ans.end());
    for(long long i=0;i<n;i++)
    {
        cout<<ans[i]<<' ';
    }
    cout<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,x;
    cin>>n;
    n--;
    vector<int>v(1);
    v[0]=4;
    while(n--)
    {
        x=v[v.size()-1]+1;
        for(int i=0;i<v.size();i++)
        {
            if(x%v[i]==0)
            {
                x++;
                i=-1;
            }
        }
        v.push_back(x);
    }

    for(int i=0;i<v.size();i++)
    {
        if(i) cout<<' '<<v[i];
        else cout<<v[i];
    }
    cout<<endl;

    return 0;
}


#include <iostream>

#define MAXN 100001
#define MAXM 10000001

using namespace std;

int primes[MAXM], idx = 0, lp[MAXM], n;

void sieve(){

}

int main(){

    ios::sync_with_stdio(0);

    int n;

    cin >> n;

    for(int i = 2; i <= MAXM && idx < n; i++){
        if(!lp[i]){
            lp[i] = i;
            primes[idx++] = i;
        }
        for(int j = 0; j < idx && primes[j] <= lp[i] && i * primes[j] <= MAXM; j++)
            lp[ i * primes[j] ] = primes[j];
    }

    for(int i = 0; i < n; i++){
        cout << primes[i] << ' ';
    }

}

// 1537926265689


#include <bits/stdc++.h>
#define f(a,b,c) for(int a=b;a<c;a++)
#define pb push_back()
#define fst first
#define snd second
using namespace std;
typedef long long ll;
int isp[10000000];
int main(){
	ios_base::sync_with_stdio(false);
	vector<int> primes;
	int n;
	f(i,2,10000){
		if(!isp[i]){
			for(int j=i*i;j<10000000;j+=i){
				isp[j]=1;
			}
		}
	}
	f(i,2,10000000)if(!isp[i])primes.push_back(i);
	cin>>n;
	f(i,0,n)cout<<primes[i]<<" ";
}
// 1482495856895


#include <bits/stdc++.h>

#define fr(a, init, end) for(int a = init; a < end; ++a)
#define add_wedge(a, b, c) to[z] = b; ant[z] = adj[a]; adj[a] = z; cost[z] = c; z++
#define add_edge(a, b) to[z] = b; ant[z] = adj[a]; adj[a] = z++
#define fre(i, u) for(int i = adj[u]; i != -1; i = ant[i])
#define sc(a) scanf("%d", &a)
#define debug(x) cerr << ">>> " << #x << " = " << x << endl;
#define dbg(x) if(1) cerr << ">>> " << x << endl;
#define _ << " , " <<
#define endl '\n'

using namespace std;

typedef long long ll;

bool mark[10000001];

int main()
{   ios::sync_with_stdio(false);cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> res;
    int i = 1;
    while(res.size() < n)
    {
        ++i;
        if(mark[i]) continue;
        res.push_back(i);
        if(i > int(1e4)) continue;
        for(int j = i * i; j < int(1e7) + 1; j += i)
            mark[j] = 1;
    }

    fr(i, 0, n)
        cout << res[i] << ' ';
    cout << endl;

    return 0;
}
// 1482075853407


#include<bits/stdc++.h>
#define fr(a, b, c) for(int a = (b); a < int(c); ++a)
#define sc(a) scanf("%d", &a);
#define sc2(a, b) scanf("%d%d", &a, &b);
#define sc3(a, b, c) scanf("%d%d%d", &a, &b, &c);

using namespace std;

typedef long long ll;

const int ms = 11111111;
const int mv = 111111;

bool isp[ms];
int n;
int p[mv];

int main(){
	memset(isp, true, sizeof isp);
	int idx = 0;
	for(int i = 2; i < ms && idx < int(1e5); ++i){
		if(!isp[i]) continue;
		p[idx++] = i;
		for(int j = 2*i; j < ms; j += i){
			isp[j] = false;
		}
	}
	sc(n);
	fr(i, 0, n){
		if(i) printf(" ");
		printf("%d", p[i]);
	}
	puts("");
	return 0;
}

// 1482080317957


#include <stdio.h>
#include <vector>

using namespace std;

typedef long long int lld;

lld primes[100000];

int main() {
  vector<bool> isPrime(1299710, true);
  int idx = 0;
  for(lld i = 2; idx < 100000; ++i) {
    if(isPrime[i]) {
      primes[idx++] = i;
      for(lld j = i*i; j < 1299710; j += i)
        isPrime[j] = false;
    }
  }
  int n;
  scanf("%d", &n);
  for(int i = 0; i < n; ++i) {
    if(i) printf(" ");
    printf("%lld", primes[i]);
  }
  puts("\n");
}
// 1481388601123


#include<iostream>
using namespace std;

int main(){
	long long int n, c=2;
	cin>>n;

	long long int i=1, temp;
	while(i<=n){
		if(c > temp and c % temp != 0){
			cout<<c<<" ";
			i++;
		}
		temp = c;
		c++;
	}

	cout<<endl;

	return 0;
}
// 1538184467871