#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

int ps[] = {2, 3, 5, 7, 11, 13, 17, 19};

int ct(int i, int cur, int mx) {
	if(i < 0) return 1;
	int pi = 1;
	int c = 0;
	for(; cur * pi <= mx; pi *= ps[i])
		c += ct(i - 1, cur * pi, mx);
	return c;
}

int k;
void build(int i, int cur, int mx) {
	if(i < 0) {
		printf("%d ", cur);
		if(--k == 0) { putchar('\n'); exit(0); }
		return;
	}
	int pi = ps[i];
	for(; cur * pi <= mx; pi *= ps[i])
		build(i - 1, cur * pi, mx);
	build(i - 1, cur, mx);
}

int main() {
	int i;
	scanf("%d", &k);
	for(i = 0;; i++) {
		if(ct(i, 1, 2 * k * k) >= k) {
			build(i, 1, 2 * k * k);
			return 0;
		}
	}
}


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

typedef long long ll;
ll p[7]={2,3,5,7,11,13},ans[10000],c=0,n,i,j;
int f[7],m[7];

void dfs(ll t,ll d,ll pp,bool flag){
	if( pp>2*n*n)return;
    else if(d<0&&flag){
        ans[c++]=pp;
        return;
    }else if(d==-1){
        c++;
        return;
    }else{
        ll cc=t;
        ll s=pp;
        while(cc>p[d]){
            cc/=p[d];
            s*=p[d];
            f[d]++;
            dfs(cc,d-1,s,flag);
        }
        dfs(t,d-1,pp,flag);
    }
}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n;
    for(i=0;i<=5;++i){
        c=0;dfs(2*n*n,i,1,0);
        if(c>=n)break;
    }
    c=0;
    dfs(2*n*n,i,1,1);
    for(i=1;i<=n;++i)cout<<ans[i]<<" ";cout<<"\n";
    return 0;
}


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

typedef long long ll;
int n,a[1000],s=1,pp,cnt;
ll ans[400000];

bool check(int x){
	if(x==2||x==3)return 1;
	if(x%6!=1&&x%6!=5)return 0;
	for(int i=5;i*i<=x;i+=6)if(x%i==0||x%(i+2)==0)return 0;
	return 1;
}

ll pow(ll x,int y){
	ll res=1;
	for(;y;y>>=1){
		if(y&1)res*=x;
		x*=x;
	}
	return res;
}

bool cmp(int a,int b){
	if(a%11==0)return 1;else if(b%11==0)return 0;else return(a>b);
}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n;
	for(int i=2;i<=2*n*n;++i)if(check(i)){
		a[i]=(int)(log(2*n*n)/log(i));
		s*=(a[i]+1);
		if(s>=n*i*2){
			pp=i;
			break;
		}
	}
	cout<<pp<<"\n";
	s=0;
	for(int i=0;i<=a[2];++i)for(int j=0;j<=a[3];++j)
		for(int k=0;k<=a[5];++k)for(int l=0;l<=a[7];++l)
			for(int m=0;m<=a[11];++m){
					int c=i+j+k+l+m;
					//cout<<i<<" "<<j<<" "<<k<<" "<<l<<" "<<m<<"\n";
					if(c<=a[2]&&l+m<=a[7]&&k+l+m<=a[5]&&j+k+l+m<=a[3]&&c>0){
						unsigned long long t=1;
						t*=pow(11ll,m);
						if(t>2*n*n)continue;
						t*=pow(7ll,l);
						if(t>2*n*n)continue;
						t*=pow(5ll,k);
						if(t>2*n*n)continue;
						t*=pow(3ll,j);
						if(t>2*n*n)continue;
						t*=pow(2ll,i);
						if(t>2*n*n)continue;
						ans[++cnt]=t;
						if(t%11==0)s++;
					}
				}
	sort(ans+1,ans+cnt+1,cmp);
	for(int i=cnt;i>cnt-2*n;i-=2)cout<<ans[i]<<" ";cout<<"\n";
	//cout<<pp<<" "<<a[11]<<" "<<cnt<<" "<<s<<"\n";
	/*for(int i=2;i<=pp;++i)if(check(i)){
		s=0;
		for(int j=cnt;j>cnt-2*n;j-=2)if(ans[j]%i==0)s++;
		if(s<n/2){
	//		cout<<i<<" "<<s<<" NO\n";
			return 0;
		}
	}
	//cout<<"YES\n";*/
	return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
//#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
//#include<list>
#include<queue>
#include<deque>
#include<algorithm>
//#include<numeric>
#include<utility>
#include<complex>
//#include<memory>
#include<functional>
#include<cassert>
#include<set>
#include<stack>

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;

int prime[15] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};

set<int> solve(int limit, int k) {
    set<int> ret;
    for (int s = (1<<limit)-1; s > 0; s--) {
        int p = 1;
        bool ng = false;
        for (int i = 0; i < 15; i++) {
            if ((s>>i)&1) {
                p *= prime[i];
                if (p > 2*k*k) {
                    ng = true;
                    break;
                }
            }
        }
        if (ng) continue;
        queue<int> que;
        que.push(p);
        while (!que.empty() && ret.size() < k) {
            int now = que.front(); que.pop();
            ret.insert(now);
            for (int i = 0; i < 15; i++) {
                if ((s>>i)&1) {
                    int next = now*prime[i];
                    if (next <= 2*k*k) que.push(next);
                }
            }
        }
        if (ret.size() == k) return ret;
    }
    return ret;
}

int cnt[15];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int k;
    cin >> k;
    for (int i = 1; i < 15; i++) {
        set<int> S = solve(i, k);
        if (S.size() < k) continue;
        memset(cnt, 0, sizeof(cnt));
        for (int el : S) {
            for (int i = 0; i < 15; i++) if (el%prime[i] == 0) cnt[i]++;
        }
        bool ng = false;
        for (int i = 0; i < 15; i++) {
            if (cnt[i] != 0 && 2*cnt[i] < k) ng = true;
        }
        if (ng) continue;
        for (int el : S) {
            cout << el << " ";
        }
        cout << endl;
        break;
    }
    return 0;
}


#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

#define rep(i,n) for(i=0;i<n;i++)
#define repft(i,a,n) for(i=a;i<n;i++)

vector<int> primes;

void make_prime(int n) {

  int i,j;
  bool f;

  primes.push_back(2);
  primes.push_back(3);
  primes.push_back(5);
  primes.push_back(7);
  primes.push_back(11);
  /*
  for(i=3;i< n;i+=2){
  	f=true;
  	repft(j,1,primes.size()){
  		if(primes[j] * primes[j] >= i)break;
  		if(i%primes[j] == 0){
  			f=false;break;
  		}
  	}
  	if(f){
  		primes.push_back(i);
  	}
   }
  /*
  printf("n:%d\n",n);
  rep(i,primes.size()){
	 printf("%d\n",primes[i]);

  }
   printf("--------\n");
   */
  return;
}

int main(){
	int k,kk2;
	int i,j,l,n,m;

	scanf("%d",&k);
	kk2=2*k*k;

	vector<int> ret(1);
	ret[0]=1;

	make_prime(kk2+100);

	rep(i,primes.size()){

		l=ret.size();
		m=0;
		rep(j,l){
			n=ret[j]*primes[i];
			while(n <= kk2){
				ret.push_back(n);
				n*=(primes[i]);
				++m;
				if(m>=k)break;
			}
		}

		//printf("   %3d %d\n",i,(int)(ret.size()));

		if(((int)(ret.size()))>=k+1)break;
	}

	//rep(i,ret.size())printf("  #%3d\n",ret[i]);

	repft(i,ret.size()-k,ret.size()-1){
		printf("%d ",ret[i]);
	}
	printf("%d\n",ret[ret.size()-1]);

}


#include<cstdio>
#include<algorithm>
#include<vector>

using namespace std;

#define rep(i,n) for(i=0;i<n;i++)
#define repft(i,a,n) for(i=a;i<n;i++)

vector<int> primes;

void make_prime(int n) {
  vector<int> Primes(n);

  for (int i = 2; i < n; ++i)
    Primes[i] = i;
  for (int i = 2; i*i < n; ++i)
    if (Primes[i])
      for (int j = i*i; j < n; j+=i)
        Primes[j] = 0;
  primes=Primes;
  return;
}

int main(){
	int k,kk2;
	int i,j,l,n;

	scanf("%d",&k);
	kk2=2*k*k;

	vector<int> ret(1);
	ret[0]=1;

	make_prime(kk2+100);

	repft(i,1,primes.size()){
		if(primes[i]==0)continue;
		l=ret.size();

		rep(j,l){
			n=ret[j]*i;
			while(n <= kk2){
				ret.push_back(n);
				n*=i;
			}
		}

		//printf("   %3d %d\n",i,(int)(ret.size()));

		if(((int)(ret.size()))>=k+1)break;
	}

	//rep(i,ret.size())printf("  #%3d\n",ret[i]);

	repft(i,ret.size()-k,ret.size()-1){
		printf("%d ",ret[i]);
	}
	printf("%d\n",ret[ret.size()-1]);

}


#include<cstdio>
#include<algorithm>
#include<vector>

using namespace std;

#define rep(i,n) for(i=0;i<n;i++)
#define repft(i,a,n) for(i=a;i<n;i++)

vector<int> primes;

void make_prime(int n) {
  vector<int> Primes(n);

  for (int i = 2; i < n; ++i)
    Primes[i] = i;
  for (int i = 2; i*i < n; ++i)
    if (Primes[i])
      for (int j = i*i; j < n; j+=i)
        Primes[j] = 0;
  primes=Primes;
  return;
}

int main(){
	int k,kk2;
	int i,j,l,n;

	scanf("%d",&k);
	kk2=2*k*k;

	vector<int> ret(1);
	ret[0]=1;

	make_prime(kk2+100);

	repft(i,1,primes.size()){
		if(primes[i]==0)continue;
		l=ret.size();

		rep(j,l){
			n=ret[j]*i;
			while(n <= kk2){
				ret.push_back(n);
				n*=i;
			}
		}

		//printf("   %3d %d\n",i,(int)(ret.size()));
		if((int)(ret.size())>=k+1)break;
	}

	//rep(i,ret.size())printf("  #%3d\n",ret[i]);

	repft(i,ret.size()-10,ret.size()-1){
		printf("%d ",ret[i]);
	}
	printf("%d\n",ret[ret.size()-1]);

}


#include<cstdio>
#include<algorithm>
#include<vector>

using namespace std;

#define rep(i,n) for(i=0;i<n;i++)
#define repft(i,a,n) for(i=a;i<n;i++)

vector<int> primes;

void make_prime(int n) {

  int i,j;
  bool f;

  primes.push_back(2);

  for(i=3;i< n;i+=2){
  	f=true;
  	repft(j,1,primes.size()){
  		if(primes[j] * primes[j] >= i)break;
  		if(i%primes[j] == 0){
  			f=false;break;
  		}
  	}
  	if(f){
  		primes.push_back(i);
  	}
   }
  /*
  printf("n:%d\n",n);
  rep(i,primes.size()){
	 printf("%d\n",primes[i]);

  }
   printf("--------\n");
   */
  return;
}

int main(){
	int k,kk2;
	int i,j,l,n;

	scanf("%d",&k);
	kk2=2*k*k;

	vector<int> ret(1);
	ret[0]=1;

	make_prime(kk2+100);

	rep(i,primes.size()){

		l=ret.size();

		rep(j,l){
			n=ret[j]*primes[i];
			while(n <= kk2){
				ret.push_back(n);
				n*=(primes[i]);
			}
		}

		//printf("   %3d %d\n",i,(int)(ret.size()));

		if(((int)(ret.size()))>=k+1)break;
	}

	//rep(i,ret.size())printf("  #%3d\n",ret[i]);

	repft(i,ret.size()-k,ret.size()-1){
		printf("%d ",ret[i]);
	}
	printf("%d\n",ret[ret.size()-1]);

}


#include<cstdio>
#include<algorithm>
#include<vector>

using namespace std;

#define rep(i,n) for(i=0;i<n;i++)
#define repft(i,a,n) for(i=a;i<n;i++)

vector<int> primes;

void make_prime(int n) {
  vector<int> Primes(n);

  for (int i = 2; i < n; ++i)
    Primes[i] = i;
  for (int i = 2; i*i < n; ++i)
    if (Primes[i])
      for (int j = i*i; j < n; j+=i)
        Primes[j] = 0;
  primes=Primes;
  return;
}

int main(){
	int k,kk2;
	int i,j,l,n;

	scanf("%d",&k);
	kk2=2*k*k;

	vector<int> ret(1);
	ret[0]=1;

	make_prime(kk2);

	repft(i,1,primes.size()){
		if(primes[i]==0)continue;
		l=ret.size();

		rep(j,l){
			n=ret[j]*i;
			while(n <= kk2){
				ret.push_back(n);
				n*=i;
			}
		}

		//printf("   %3d %d\n",i,(int)(ret.size()));
		if((int)(ret.size())>=k+1)break;
	}

	repft(i,ret.size()-10,ret.size()-1){
		printf("%d ",ret[i]);
	}
	printf("%d\n",ret[ret.size()-1]);

}


#include <bits/stdc++.h>
#define debug(args...) //fprintf(stderr, args)
#define pb push_back
using namespace std;

typedef long long lint;

const int MAXP = 14;
lint p[MAXP] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43};
vector<lint> v;
lint k;

void f(lint num, int idx, int last) {
    if(idx > last) return;
    if(num * p[idx] <= 2 * k * k) {
        v.pb(num * p[idx]);
        f(num * p[idx], idx, last);
    }
    f(num, idx + 1, last);
}

void g(lint num, int idx, int last) {
    if(idx > last || num > 2 * k * k) return;
    //debug("num = %lld\nidx = %d\nlast = %d\n", num, idx, last);
    for(int i = idx + 1; i <= last; i++) {
        if(num * p[i] <= 2 * k * k) {
            debug("ENTROU %lld\n", num * p[i]);
            v.pb(num * p[i]);
        }
    }
    g(num * p[idx], idx, last);
    g(num, idx + 1, last);
}

void go() {
	for(int i = 1; i < MAXP; i++) {
        v.clear();
        debug("TENTANDO %d\n", i);
        g(1, 0, i);
        set<lint> s;
        for(lint val : v) s.insert(val);
        if(s.size() >= k) {
            debug("FECHOU\n");
            int cnt = 0;
            for(auto it = s.rbegin(); it != s.rend(); it++) {
                printf("%lld ", *it);
                cnt++;
                if(cnt == k) break;
            }
            return;
        }
    }
}

int main() {
	vector<lint> v;
	scanf("%lld", &k);
	go();
	return 0;
}

// 1472260749697


#include <bits/stdc++.h>
#define debug(args...) //fprintf(stderr, args)
#define pb push_back
using namespace std;

typedef long long lint;

const int MAXP = 14;
lint p[MAXP] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43};
set<lint> v;
lint k;

void f(lint num, int idx, int last) {
    if(idx > last) return;
    if(num * p[idx] <= 2 * k * k) {
        v.insert(num * p[idx]);
        f(num * p[idx], idx, last);
    }
    f(num, idx + 1, last);
}

void g(lint num, int idx, int last) {
    if(idx > last) return;
    if(num <= 2 * k * k) {
        debug("num = %lld\n", num);
        v.insert(num);
    }
    g(num, idx + 1, last);
    if(num * p[idx] <= 2 * k * k) g(num * p[idx], idx, last);
}

void go() {
	for(int i = 1; i < MAXP; i++) {
        v.clear();
        lint ans = 1;
        for(int j = 0; j <= i; j++) ans *= p[j];
        v.insert(ans);
        f(ans, 0, i);
        debug("Tamanho antes %d\n", (int) v.size());
        g(2, 0, i);
        debug("Tamanho depois %d\n", (int) v.size());
        if(v.size() >= k) {
            debug("FECHOU\n");
            int cnt = 0;
            for(lint val : v) {
                printf("%lld ", val);
                cnt++;
                if(cnt == k) break;
            }
            return;
        }
    }
}

int main() {
	vector<lint> v;
	scanf("%lld", &k);
	go();
	return 0;
}

// 1472252451915


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

#define debug(args...) fprintf(stderr,args)

typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;

const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;
const int MAXK = 5010;
const int MAXV = 2 * MAXK * MAXK;

set<int> allowed;
vector<int> primes;
int freq[10];
int maxv;

bool check(int k) {
    if ((int)allowed.size() < k) return 0;
    memset(freq, 0, sizeof(freq));
    for (int n: allowed)
        for (int i = 0; i < (int)primes.size(); i++)
            if (n % primes[i] == 0)
                freq[i]++;
    for (int i = 0; i < (int)primes.size(); i++)
        if (2 * freq[i] < k)
            return 0;
    return 1;
}

int main() {
    int k;
    scanf("%d", &k);
    primes.clear();
    allowed.clear();
    for (int p: {2, 3, 5, 7, 11, 13}) {
        primes.push_back(p);
        allowed.insert(p);
        for (int s = 0; s < 4; s++) {
            for (auto it = allowed.rbegin(); it != allowed.rend(); it++)
                if (*it * p <= 2 * k * k)
                    allowed.insert(*it * p);
        }
        if (check(k)) {
            // printf("done with p = %d\n", p);
            int cnt = 0;
            for (int n: allowed) {
                printf("%d%c", n, cnt + 1 == k ? '\n' : ' ');
                if (++cnt == k) break;
            }
            break;
        }
    }
    return 0;
}

// 1471993271732


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

#define debug(args...) fprintf(stderr,args)

typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;

const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;
const int MAXK = 5010;
const int MAXV = 2 * MAXK * MAXK;

set<int> allowed;
vector<int> primes;
int freq[10];
vector<int> v;

bool check(int k) {
    if ((int)allowed.size() < k) return 0;
    v = vector<int>(allowed.begin(), allowed.end());
    for (int t = 0; t < 10; t++) {
        memset(freq, 0, sizeof(freq));
        int cnt = 0;
        random_shuffle(v.begin(), v.end());
        for (int j = 0; j < k; j++) {
            int n = v[j];
            cnt++;
            for (int i = 0; i < (int)primes.size(); i++)
                if (n % primes[i] == 0)
                    freq[i]++;
            if (cnt == k) break;
        }
        bool ok = 1;
        for (int i = 0; i < (int)primes.size(); i++) {
            if (2 * freq[i] < k) {
                ok = 0;
                break;
            }
        }
        if (ok) return 1;
    }
    return 0;
}

int main() {
    int k;
    scanf("%d", &k);
    for (int p: {2, 3, 5, 7, 11, 13, 17, 19, 23}) {
        primes.push_back(p);
        allowed.insert(p);
        for (int x: allowed)
            if (x * p <= 2 * k * k)
                allowed.insert(x * p);
        if (check(k)) {
            for (int i = 0; i < k; i++)
                printf("%d%c", v[i], i + 1 == k ? '\n' : ' ');
            break;
        }
    }
    return 0;
}
// 1472124248948


#include<bits/stdc++.h>
using namespace std;
int k,p,limit;
const int prime[]={2,3,5,7,11,13};
unordered_set<int>ans;
void dfs(int i,int64_t m) {
 if(m>limit)return;
 if(i==6) {
  if(ans.size()<k)ans.insert(m);
  if(ans.size()==k) {
   for(auto&&x:ans)printf("%d ",x);
   exit(0);
  }
  return;
 }
 if(p>>i&1) {
  dfs(i+1,m*prime[i]);
  dfs(i+1,m);
  m*=prime[i];
  while((m*=prime[i])<=limit)dfs(i+1,m);
 } else dfs(i+1,m);
}
int main() {
 scanf("%d",&k);limit=2*k*k;
 for(p=1;p<1<<6;++p) {
  ans.clear();dfs(0,1);
 }
 return 0;
}


#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define red(i, a, b) for (int i = (a); i >= (b); --i)
#define clr( x , y ) memset(x,y,sizeof(x))
#define sqr(x) ((x) * (x))
typedef long long lint;
int a[8] = { 0 , 2 , 3 , 5 , 7 , 11 , 13 , 17};
int n,m,ans[1000000],s,ma;

void init()
{
    cin>>n;
    ma = n * n * 2;
}

void dfs(int t,int k)
{
    if ( t > m ) {
        ans[s++] = k;
        return;
    }
    dfs(t+1,k);
    while ( k * a[t] <= ma ) {
        k *= a[t];
        dfs(t+1,k);
    }
}

void work()
{
    rep(i,2,6) {
        m = i;
        s = 0;
        dfs(1,1);
        if ( s < 2 * n ) continue;
        sort(ans,ans+s);
        rep(j,1,n-1) printf("%d ",ans[s-j]);
        printf("%dn",ans[s-n]);
        break;
    }
}

int main()
{
    init();
    work();
    return 0;
}


/**Bismillahir Rahmanir Rahim  *///{
#include <bits/stdc++.h>
using namespace std;
#define inf 1000000007
#define llinf 1000000000000000000LL
#define eps 0.000000001
#define im(_x, _mod) if (_x >= _mod) _x -= _mod; else if (_x<0) _x += _mod;
#define bug(args ...) cout << __LINE__ << ": ", err(new istringstream(string(#args)), args), cout << '\n'
inline void err(istringstream *iss) {}
template<typename T, typename ... Args> void err(istringstream *iss, const T &$val, const Args & ... args) {
    string $name; *iss >> $name; if ($name.back()==',') $name.pop_back();
    cout << $name << " = " << $val << "; ", err(iss, args ...);
}
using ll = long long; using ull = unsigned long long; using ld = long double;
int n, m, K, T, Q, cn;//}
#define mxn 5005

int x;

bool getBit(const int &posFromRight) { return (1u&(m>>posFromRight)); }
void setBit(const int &posFromRight) { m |= (1u<<posFromRight); }
int LSB() { return (m & -m); } // returns an int with only LSB 1 of m set

int next_popcount() {  // returns next integer with same number of set bits
    int c = LSB();
    int r = m+c;
    return (((r ^ m) >> 2) / c) | r;
}

int nCnBy2[] = {0, 1, 2, 3, 6, 10, 20, 35, 70, 126, 252, 462, 924, 1716, 3432, 6435};
int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
// ll outs[mxn];

int main() { cin.tie(NULL);

    scanf("%d", &K);
    for (int i = 0; i < 16; i++) {
        if (nCnBy2[i] >= K) {x = i; break;}
    }
    for (int i = 0; i < x>>1; i++) {
        setBit(i);
    }
    ll os;
    for (int i = 0; i < K; i++) {
        os = 1;
        for (int j = 0; j < 16; j++) {
            if (getBit(j)) os *= primes[j];
        }
        if (os > 2ll*K*K) i--;
        printf("%lld%c", os, " \n"[i==K-1]);
        m = next_popcount();
    }

return 0; }


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

vector <int> o{1}, ps{2,3,5,7,11};

int main() {
	int n;
	scanf("%d", &n);
	for (auto p: ps) {
		if ((int)o.size() > n) break;
		for (int i=0; i<(int)o.size(); ++i) if (o[i]*p<=2*n*n) o.push_back(o[i]*p);
	}
	for (int i=0; i<n; ++i) printf("%d ", *(o.rbegin()+i));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<PII> VPII;
typedef vector<string> VS;
#define SI(x) (int(x.size()))
#define FOR(x, b, e) for(int x = b; x <= (e); ++x)
#define FORD(x, b, e) for(int x = b; x >= (e); --x)
#define REP(n) for(int x = 0; x < (n); ++x)
#define ALL(c) (c).begin(), (c).end()
#define PB push_back
#define MP make_pair

int k;
int menszczysna;
int pr[10];
VI grzybki;

void nasyc(int i)
{
  if(i==1)
  {
    int tmp=2;
    while(tmp<=menszczysna)
    {
      cerr<<tmp<<endl<<"SZMOATO\n";
      grzybki.PB(tmp);
      tmp*=2;
    }
    return;
  }
  int si=SI(grzybki)-1;
  LL tmp;
  FOR(j,0,si)
  {
    tmp=grzybki[j];
    tmp*=pr[i-1];
    while(tmp<=menszczysna)
    {
      grzybki.PB(tmp);
      tmp*=pr[i-1];
      cerr<<tmp<<" "<<"RUDY CHUJ\n";
    }
  }
}

void make()
{
  pr[0]=2;
  pr[1]=3;
  pr[2]=5;
  pr[3]=7;
  pr[4]=11;
  pr[5]=13;
  pr[6]=17;
  pr[7]=19;
  pr[8]=23;
  pr[9]=29;
  menszczysna=2*k*k;
}

VI towar;
VI mieszania[21];

void szejkujAssa()
{
  FOR(i,0,SI(towar)-1)
    mieszania[0].PB(towar[i]);
  FOR(i,1,20)
  {
    FORD(j,SI(mieszania[i-1])-1,0)
      mieszania[i].PB(mieszania[i-1][j]);
  }
}

int main()
{
  cin>>k;
  make();
  cerr<<"PIERDOL SIE\n";
  FOR(i,1,10)
  {
    nasyc(i);
    if(grzybki.size()>=k)
    {
      FORD(i,SI(grzybki)-1,0)
      {
	towar.PB(grzybki[i]);
	if(towar.size()==k)
	  break;
      }
      break;
    }
    cerr<<i<<endl;
  }
  cerr<<"SSJIJIJIASDISAODJ\n";
  szejkujAssa();
  FOR(i,0,SI(mieszania[20])-1)
    cout<<mieszania[20][i]<<" ";
  return 0;
  cout<<"NO KURWA";
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define mk make_pair
#define pb push_back
#define CH (ch=getchar())
#define dprintf(...) fprintf(stderr,__VA_ARGS__)
#define rep(i,V)     for(__typeof(*V.begin()) i:  V)
#define For(i,a,b)   for(int i=(int)a;i<=(int)b;i++)
#define Rep(i,a,b)   for(int i=(int)a;i< (int)b;i++)
#define Forn(i,a,b)  for(int i=(int)a;i>=(int)b;i--)
#define pend(x)      ((x)=='\n'||(x)=='\r'||(x)=='\t'||(x)==' ')
using namespace std;
typedef	double		db;
typedef	long long	ll;
const int N=100005;

inline int IN(){
	char ch;CH; int f=0,x=0;
	for(;pend(ch);CH); if(ch=='-')f=1,CH;
	for(;!pend(ch);CH) x=x*10+ch-'0';
	return (f)?(-x):(x);
}

int Pow(int x,int y,int p){
	int A=1;
	for(;y;y>>=1,x=(ll)x*x%p) if(y&1) A=(ll)A*x%p;
	return A;
}

vector<int> sol;
int p[5005],n;

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

	For(i,1,5000) p[i]=1;
	for(int i=2;(int)sol.size()<n;i++){
		if(!p[i])continue;
		sol.pb(i);
		for(int j=0;j<(int)sol.size();j++){
			if(1ll*sol[j]*i<=1ll*n*n*2){
				sol.pb(sol[j]*i);
			}
		}
		for(int j=i+i;j<=n;j+=i) p[j]=0;
	}

	for(int i=(int)sol.size()-1;i>=(int)sol.size()-n;i--) printf("%d ",sol[i]);
	return 0;
}


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

#define fre freopen("input.txt","r",stdin)
#define ll long long
#define abs(x) ((x)>0?(x):-(x))
#define M 1000000007
#define scand(x) scanf("%d",&x);
#define scanlld(x) scanf("%I64d",&x);
#define scans(x) scanf("%s",x);
#define printd(x) printf("%d",x);
#define printlld(x) printf("%I64d",x);
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define inf (1<<30)
#define forup(i,a,b) for(int i=a;i<b;i++)
#define pii pair<int,int>
#define boost ios_base::sync_with_stdio(0)
#define MAXN 100003
int main()
{
	boost;
	//fre;
	int k;
	cin>>k;
	forup(i,1,k+1)cout<<1LL*6*i<<" ";
	return 0;
}


#include<cstdio>
#include<cstdlib>
#include<vector>
#include<algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define pb push_back
int prime[5]={2,3,5,7,11};
int k;
vector <int> ans;
int main(){
    scanf("%d",&k);
    for(int use=1;use<=5;use++){
        ans.clear();
        ans.pb(1);
        rep(i,use){
            rep(j,ans.size()){
                if(ans[j]*prime[i]<=k*k*2) ans.pb(ans[j]*prime[i]);
            }
        }
        if(ans.size()>k) break;
    }
    sort(ans.begin(),ans.end());
    for (int i=ans.size()-k;i<ans.size();i++) printf("%d ",ans[i]);
}


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

vector<int>o{1},ps{2,3,5,7,11};

int main(){
int n;
scanf("%d",&n);
for(auto p: ps){
if((int)o.size()>n)break;
for(int i=0;i<(int)o.size();++i)if(o[i]*p<=2*n*n)o.push_back(o[i]*p);
}
for(int i=0;i<n;++i)printf("%d ",*(o.rbegin()+i));
return 0;
}


#include <set>
#include <cstdio>

using namespace std;

int n, primes[] = {2, 3, 5, 7, 11, 13, 17, 19}, counters[20];
long long max_val;
set <long long> result;

void rec(int step, int limit, long long num) {
    if (step == limit) {
        if (num != 1) {
            result.insert(num);
            if (result.size() > n) {
                result.erase(result.begin());
            }
        }
    } else {
        long long mult = 1;
        while (true) {
            long long new_num = num * mult;
            if (new_num <= max_val) {
                rec(step + 1, limit, new_num);
            } else {
                break;
            }
            mult *= primes[step];
        }
    }
}

int main() {

    scanf("%d", &n);

    max_val = 2 * n * n;

    for (int m = 2;; m++) {
        bool ok = true;
        result.clear();
        rec(0, m, 1);
        for (int i = 0; i < m; i++) {
            counters[i] = 0;
        }
        for (set <long long>::iterator it = result.begin(); it != result.end(); it++) {
            long long num = *it;
            for (int i = 0; i < m; i++) {
                if (num % primes[i] == 0) {
                    counters[i]++;
                }
            }
        }
        for (int i = 0; i < m; i++) {
            ok &= counters[i] >= (n + 1) / 2;
        }
        if (ok) {
            for (set <long long>::iterator it = result.begin(); it != result.end(); it++) {
                long long num = *it;
                if (it != result.begin()) {
                    printf(" ");
                }
                printf("%I64d", num);
            }
            puts("");
            break;
        }
    }

    return 0;

}


#include <set>
#include <cstdio>

using namespace std;

int n, primes[] = {2, 3, 5, 7, 11, 13, 17, 19}, counters[20];
long long max_val;
set <long long> result;

void rec(int step, int limit, long long num) {
    if (step == limit) {
        if (num != 1) {
            result.insert(num);
            if (result.size() > n) {
                result.erase(result.begin());
            }
        }
    } else {
        long long mult = 1;
        while (true) {
            long long new_num = num * mult;
            if (new_num <= max_val) {
                rec(step + 1, limit, new_num);
            } else {
                break;
            }
            mult *= primes[step];
        }
    }
}

int main() {

    scanf("%d", &n);

    max_val = 2 * n * n;

    for (int m = 2;; m++) {
        bool ok = true;
        result.clear();
        rec(0, m, 1);
        for (int i = 0; i < m; i++) {
            counters[i] = 0;
        }
        for (set <long long>::iterator it = result.begin(); it != result.end(); it++) {
            long long num = *it;
            for (int i = 0; i < m; i++) {
                if (num % primes[i] == 0) {
                    counters[i]++;
                }
            }
        }
        for (int i = 0; i < m; i++) {
            ok &= counters[i] >= (n + 1) / 2;
        }
        if (ok && result.size() == n) {
            for (set <long long>::iterator it = result.begin(); it != result.end(); it++) {
                long long num = *it;
                if (it != result.begin()) {
                    printf(" ");
                }
                printf("%I64d", num);
            }
            puts("");
            break;
        }
    }

    return 0;

}


#include<bits/stdc++.h>

using namespace std;

#define in(a,x,y) (a>=x && a<=y)
#define out(a,x,y) (!in(a,x,y))
#define sz(a) ((int)a.size())
#define repv(i,a) for(int i=0;i<sz(a);i++)
#define revv(i,a) for(int i=sz(a)-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define pb push_back

#define AND(a,b) ((a) & (b))
#define OR(a,b) ((a)|(b))
#define XOR(a,b) ((a) ^ (b))
#define xx first
#define yy second
#define mp make_pair
#define sqr(x) ((x)*(x))
#define sqrt(x) sqrt(1.0*(x))

#define LB(a,x) (lower_bound(all(a),x)-a.begin()) //  first element in the range [first,last) which does not compare less than val.
#define UB(a,x) (upper_bound(all(a),x)-a.begin()) //  first element in the range [first,last) which compares greater than val.
#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it++)
#define left nokol_left
#define right nokol_right
#define countbit(x) __builtin_popcountll((ll)x)
#define PQ priority_queue
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);
#define Unique(store) store.resize(unique(store.begin(),store.end())-store.begin())
#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;

template<class T>T __sqr(const T x){return x*x;}
template< class T, class X > inline T __pow(T a,X y) {T z=1; rep(i,1,y){z*=a;} return z; }
template< class T > inline T gcd(T a,T b) {a=abs(a);b=abs(b); if(!b) return a; return __gcd(b,a%b);}
template< class T > inline T lcm(T a,T b) {a=abs(a);b=abs(b); return (a/__gcd(a,b))*b;}
inline bool ispow2(int x){return (x!=0 && (x&(x-1))==0);}
template<class T>void UpdateMin(T &x,T y){  if(y<x){x=y;}}
template<class T>void UpdateMax(T &x,T y){if(x<y){x=y;}}
template<class T,class X, class Y > inline T bigmod(T n,X m,Y mod){ull ret=1, a = n%mod ; while(m){ if(m&1)ret=(ret*a)%mod; m>>=1; a=(a*a)%mod; }ret%=mod;return (T)ret;}
template<class T, class Y > inline T modinv(T n,Y mod) {return bigmod(n,mod-2,mod);}

template<class T,class X> int getbit(T s,X i) { return (s >> i) & 1; }
template<class T,class X> T onbit(T s, X i) { return s | (T(1) << i); }
template<class T,class X> T offbit(T s, X i) { return s & (~(T(1) << i)); }
template<class T> inline void read(T &n){char c;for (c = getchar(); !(c >= '0' && c <= '9'); c = getchar()); n = c - '0';for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';}

void extended_euclid(ll a,ll b,ll &x,ll &y){ if(!b){ x = 1 , y = 0  ;  return ;} ll xx,yy; extended_euclid(b,a%b,xx,yy); x = yy; y = xx - (a/b)*yy; }
pair<ll, pair<ll, ll> > extendedEuclid(ll a, ll b) { ll x = 1, y = 0; ll xLast = 0, yLast = 1; ll q, r, m, n; while(a != 0) {q = b / a; r = b % a; m = xLast - q * x; n = yLast - q * y; xLast = x, yLast = y; x = m, y = n; b = a, a = r; } return make_pair(b, make_pair(xLast, yLast)); }

const ll mod[]  ={0,1000000007,1000000009,1000000021,1000000033,1000000097,1000000093,1000000097,1000000103};
const ll base[] ={0,1000003,1000033,1000037,1000039,1000081,1000099,1000117,1000121};

#define eps  1e-15
#define MX   (lmt + 20 )
#define inf  1000000000LL
#define MOD  1000000007
//---------->0123456789123465789
#define lmt  50000000

set<int>v[400];
//stack<int>stk[400];

int vis[MX];
int lm;
void dfs(int x , int b){

    if( lm < x ){
        return ;
    }

    if(b){
        v[b].insert(x);
    }
    if(vis[x]) return ;
    vis[x] = 1;

    dfs(x*2  ,b | (1<<0) );
    dfs(x*3  ,b | (1<<1) );
    dfs(x*5  ,b | (1<<2) );
    dfs(x*7  ,b | (1<<3) );
    dfs(x*11 ,b | (1<<4) );
    dfs(x*13 ,b | (1<<5) );
    dfs(x*17 ,b | (1<<6) );
}

int sum[500];
int main()
{
    int n ;
    cin>>n;
    lm = n*n*2;
    dfs(1,0);

    int tmp = 0 ;
    rep(i,1,128){
        sum[i] = sum[i-1] + v[i].size();
    }

    int one = 1;
    int a,b , c,d;
    a =b = d = c = 0;
    while(one){

        if(sum[one]>=n){
//            cout<<"one "<<one<<" "<<sum[one]<<endl;
//            return 0;
            rev(i,one,1){

                for(set<int>::iterator it = v[i].begin();it!=v[i].end();it++){

                    if(n>0){
//                        printf("%d " ,i);
                        printf("%d%c" ,(*it),n==1?'\n':' ');

//                        int val = (*it);
//                        if((val%2==0)) a++;
//                        if((val%3==0)) b++;
//                        if((val%4==0)) c++;
//                        if((val%5==0)) d++;

                        n--;
                    }
                }
            }

           break;
        }
        one = one*2 +  1;
    }

//    cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;

    return 0;
}


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

vector <int> o{1}, ps{2,3,5,7,11};

int main() {
	int n;
	scanf("%d", &n);
	for (auto p: ps) {
		if ((int)o.size() > n) break;
		for (int i=0; i<(int)o.size(); ++i) if (o[i]*p<=2*n*n) o.push_back(o[i]*p);
	}
	for (int i=0; i<n; ++i) printf("%d ", *(o.rbegin()+i));
	return 0;
}//hello//hellobig_tq


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

vector <int> o{1}, ps{2,3,5,7,11};

int main() {
	int n;
	scanf("%d", &n);
	for (auto p: ps) {
		if ((int)o.size() > n) break;
		for (auto i: o) if (i*p<=2*n*n) o.push_back(i*p);
	}
	for (int i=0; i<n; ++i) printf("%d ", *(o.rbegin()+i));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
const int N = (int)5e7+7;
lint prime[] = {2, 3, 5, 7, 11, 13, 17,
                19, 23, 29, 31, 37, 41,
                43, 47, 53, 59, 61, 67, 71};
lint ans[N];

int main() {
    lint n;
    scanf(" %lld", &n);
    lint k = 0;
    lint r = 1;
    ans[0] = 1;
    for (int i = 0; i < 20; i++) {
        k = r;
        for (int j = 0; j < r; j++) {
            if (ans[j]*prime[i] <= 2ll*n*n) {
                ans[k] = ans[j]*prime[i];
                k++;
            }
        }
        r = k;
        if (k >= n)
            break;
    }
    //printf("%lld\n", k);
    //for (int i = 0; i < k; i++)
        //printf("%lld ", ans[i]);
    //printf("\n");
    sort(ans, ans+k);
    for (int i = k-1; i >= k-n; i--)
        printf("%lld ", ans[i]);
    printf("\n");
}

// 1472253860939


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

#define debug(args...) fprintf(stderr,args)

typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;

const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;
const int MAXK = 5010;
const int MAXV = 2 * MAXK * MAXK;

set<int> allowed;
vector<int> primes;
int freq[10];
vector<int> v;

bool check(int k) {
    if ((int)allowed.size() < k) return 0;
    v = vector<int>(allowed.begin(), allowed.end());
    for (int t = 0; t < 10; t++) {
        memset(freq, 0, sizeof(freq));
        int cnt = 0;
        random_shuffle(v.begin(), v.end());
        for (int j = 0; j < k; j++) {
            int n = v[j];
            cnt++;
            for (int i = 0; i < (int)primes.size(); i++)
                if (n % primes[i] == 0)
                    freq[i]++;
            if (cnt == k) break;
        }
        bool ok = 1;
        for (int i = 0; i < (int)primes.size(); i++) {
            if (2 * freq[i] < k) {
                ok = 0;
                break;
            }
        }
        if (ok) return 1;
    }
    return 0;
}

int main() {
    int k;
    scanf("%d", &k);
    // for (int k = 10; k <= 5000; k++) {
    //     primes.clear();
    //     allowed.clear();
    //     bool found = 0;
    for (int p: {2, 3, 5, 7, 11, 13, 17, 19, 23}) {
        primes.push_back(p);
        allowed.insert(p);
        for (int s = 0; s < 5; s++) {
            for (auto it = allowed.rbegin(); it != allowed.rend(); it++)
                if (*it * p <= 2 * k * k)
                    allowed.insert(*it * p);
        }
        if (check(k)) {
            // debug("k = %d: OK!\n", k);
            // found = 1;
            // printf("done with p = %d\n", p);
            for (int i = 0; i < k; i++)
                printf("%d%c", v[i], i + 1 == k ? '\n' : ' ');
            break;
        }
    }
    // if (!found) {
    //     debug("FAILED for k = %d\n", k);
    //     return 0;
    // }
    // }
    return 0;
}

// 1471994842508


#include <iostream>

#include <iomanip>

#include <algorithm>

#include <cmath>

#include <assert.h>

#include <stdio.h>

#include <ctime>

#include <cstdlib>

#include <string>

#include <utility>

#include <string.h>

#include <vector>

#include <queue>

#include <stack>

#include <set>

#include <map>

#include <complex>

#define inf (1<<30)

#define pii pair<int,int>

#define pip pair<int,pii>

#define pll pair<long long,long long>

#define pif pair<int,double>

#define pdp pair<double,pii>

#define pcc pair<char,char>

#define eps 1e-7

#ifdef ONLINE_JUDGE

#define debug(args...)

#else

#define debug(args...) fprintf(stderr,args)

#endif

#define pb push_back

#define maxn 1000200

#define mod 1000000007

#define min3(a,b,c) min(min(a,b),c)

#define max3(a,b,c) max(max(a,b),c)

#define count fusrf

typedef long long ll;

using namespace std;

int pr[] = {2,3,5,7,11,13,17,19};

int big[50000005];
int c[10];

int ans[10100];

main(){

	int k;
	scanf("%d",&k);

	big[1] = 0;

	for(int i=0;i<7;i++)
		big[pr[i]] = i+1;

	/*for(int i=2;i<=2*k*k;i++){
		big[i] = -1;
		for(int j=0;j<7;j++)
			if(i%pr[j] == 0){
				big[i] = max(j,big[i/pr[j]]);
				continue;
			}
			if(big[i] == -1) big[i] = 10;
			else
				for(int j=big[i];j<7;j++)
					c[j]++;
		}*/

	for(int i=2;i<=2*k*k;i++){

		if(big[i] == 0) continue;

		for(int j=0;j<7;j++){

			// debug("try %d\n",i*pr[j]);

			if(i * pr[j] <= 2*k*k){
				big[i*pr[j]] = max(big[i],j+1);
			//	debug("%d -> %d\n",i*pr[j],big[i*pr[j]]);
			}
		//	else break;

		}

	//	debug("i %d big %d\n",i,big[i]);

		for(int j=big[i]-1;j<7;j++)
			c[j]++;

	}

	for(int j=0;j<7;j++)
		if(c[j] >= k){
			int sz = 0;
			for(int i=2*k*k;i>=0;i--)
				if(big[i] != 0 && big[i]-1 <= j && big[i/pr[big[i]-1]]-1 < big[i]-1){
					ans[sz++] = i;
					if(sz == k) break;
				}
			if(sz < k) continue;
			for(int i=sz-1;i>=0;i--)
				printf("%d ",ans[i]);
			printf("\n");
			return 0;
		}

}
// 1473625645703


#include <bits/stdc++.h>
using namespace std;
const int N = (int)5e7+7;
int prime[] = {2, 3, 5, 7, 11};
int ans[N];

int main() {
    int n;
    scanf(" %d", &n);
    int r = 1;
    ans[0] = 1;
    for (int i = 0; i < 5; i++) {
        for (int j = 0; j < r; j++) {
            if (ans[j]*prime[i] <= 2ll*n*n) {
                ans[r] = ans[j]*prime[i];
                r++;
            }
        }
        if (r >= n)
            break;
    }
    //printf("%lld\n", k);
    //for (int i = 0; i < k; i++)
        //printf("%lld ", ans[i]);
    //printf("\n");
    for (int i = r-n; i < r; i++)
        printf("%d ", ans[i]);
    printf("\n");
}

// 1472262162123


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

const int p[] = {2, 3, 5, 7, 11, 13, 17};
int n, up;
int k[10000005], idx;

void dfs(int pos, int v, int e) {
	if(pos == e) {
		k[++ idx] = v;
		return ;
	}
	dfs(pos + 1, v, e);
	while(v * p[pos] <= up) {
		v *= p[pos];
		dfs(pos + 1, v, e);
	}
}

int main () {
	scanf("%d", &n); up = 2 * n * n;
	for(int i = 2; ; ++ i) {
		idx = 0, dfs(0, 1, i);
		if(idx < 2 * n) continue;
		sort(k + 1, k + 1 + idx);
		for(int i = idx; i >= idx - n + 1; -- i) {
			if(i < idx) putchar(' ');
			printf("%d", k[i]);
		}puts("");
		return 0;
	}
	return 0;
}


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

const int p[] = {2, 3, 5, 7, 11, 13, 17};
int n, up;
int k[10000005], idx;

void dfs(int pos, int v, int e) {
	if(pos == e) {
		k[++ idx] = v;
		return ;
	}
	dfs(pos + 1, v, e);
	while(v * p[pos] <= up) {
		v *= p[pos];
		dfs(pos + 1, v, e);
	}
}

int main () {
	scanf("%d", &n); up = 2 * n * n;
	for(int i = 2; ; ++ i) {
		idx = 0, dfs(0, 1, i);
		if(idx < 2 * n) continue;
		sort(k + 1, k + 1 + idx);
		for(int i = 2; i <= n + 1; ++ i) {
			if(i > 2) putchar(' ');
			printf("%d", k[i]);
		}puts("");
		return 0;
	}
	return 0;
}


#include <bits/stdc++.h>
#define esp 1e-14
#define inf 0x0f0f0f0f
#define in freopen("F:\\code\\data\\solve_in.txt", "r", stdin);
#define out freopen("F:\\code\\data\\solve_out.txt", "w", stdout);
#define bug(x) printf("Line: %d >>>>>>>>>>\n", (x));
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef map<PII, int> MPII;
const int maxn = 5000 * 5000 * 2 + 2;

short vis[maxn];
int p[4] = {2, 3, 5, 7};
set<PII> S;
vector<int> arr;
set<int> Se;
vector<int> nums;

int main() {
//  in
  int n;
  cin >> n;
  Se.insert(1);
  while (Se.size()) {
    auto it = Se.begin();
    int u = *it;
    nums.push_back(u);
    Se.erase(it);
    for (int i = 0; i < 4; i++) {
      if (p[i]*u > 2 * n * n) {
        break;
      }
//      cout << p[i]*u << endl;
      Se.insert(p[i]*u);
    }
  }
  for (auto it : nums) {
    int div = 0;
    for (int i = 0; i < 4; i++) {
      div += (it % p[i]) == 0;
    }
    S.insert(PII(-div, it));
  }
//  puts("1");
  int cnt = 0;
  for (auto it : S) {
    cnt++;
    printf("%d%c", it.second, cnt == n ? '\n' : ' ');
    if (cnt == n) {
//      puts("");
      break;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
#define esp 1e-14
#define inf 0x0f0f0f0f
#define in freopen("F:\\code\\data\\solve_in.txt", "r", stdin);
#define out freopen("F:\\code\\data\\solve_out.txt", "w", stdout);
#define bug(x) printf("Line: %d >>>>>>>>>>\n", (x));
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef map<PII, int> MPII;
const int maxn = 5000*5000*2 + 2;

short vis[maxn];
int p[4] = {2, 3, 5, 7};
int a[maxn];

int main() {
//  in
  int n;
  cin >> n;
  for (int i = 0; i < 4; i++) {
    for (int j = p[i]; j <= 2*n*n; j += p[i]) {
      vis[j]++;
    }
  }
  for (int i = 1; i <= 2*n*n; i++) {
    a[i] = i;
  }
  sort(a+1, a+2*n*n+1, [] (const int& x, const int& y) {
    return vis[x] > vis[y];
  });
  for (int i = 1; i <= n; i++) {
    printf("%d%c", a[i], i == n ? '\n' : ' ');
  }
  return 0;
}


#include <bits/stdc++.h>
#define esp 1e-14
#define inf 0x0f0f0f0f
#define in freopen("F:\\code\\data\\solve_in.txt", "r", stdin);
#define out freopen("F:\\code\\data\\solve_out.txt", "w", stdout);
#define bug(x) printf("Line: %d >>>>>>>>>>\n", (x));
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef map<PII, int> MPII;

const int maxn = 5000 * 5000 * 2 + 2;
int mx;
short vis[maxn];
int p[5] = {2, 3, 5, 7, 11};
set<PII> S;
vector<int> arr;
set<int> Se;
vector<int> nums;

int main() {
//  in
  int n;
  cin >> n;
  Se.insert(1);
  mx = 5;
//  if (n > 2000) {
//    mx = 5;
//  }
  while (Se.size()) {
    auto it = Se.begin();
    int u = *it;
    nums.push_back(u);
    Se.erase(it);
    for (int i = 0; i < mx; i++) {
      if (p[i]*u > 2 * n * n) {
        break;
      }
      Se.insert(p[i]*u);
    }
  }
  for (auto it : nums) {
    int div = 0;
    for (int i = 0; i < mx; i++) {
      div += (it % p[i]) == 0;
    }
    if (div > 2 || n < 2000)
      S.insert(PII(-div, it));
  }
  int cnt = 0;
  vector<int> ans;
  for (auto it : S) {
    cnt++;
    printf("%d%c", it.second, cnt == n ? '\n' : ' ');
    if (cnt == n) {
      break;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
#define esp 1e-14
#define inf 0x0f0f0f0f
#define in freopen("F:\\code\\data\\solve_in.txt", "r", stdin);
#define out freopen("F:\\code\\data\\solve_out.txt", "w", stdout);
#define bug(x) printf("Line: %d >>>>>>>>>>\n", (x));
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef map<PII, int> MPII;

const int maxn = 5000 * 5000 * 2 + 2;
int mx;
short vis[maxn];
int p[5] = {2, 3, 5, 7, 11};
set<PII> S;
vector<int> arr;
set<int> Se;
vector<int> nums;

int main() {
//  in
  int n;
  cin >> n;
  Se.insert(1);
  mx = 4;
  if (n > 2000) {
    mx = 5;
  }
  while (Se.size()) {
    auto it = Se.begin();
    int u = *it;
    nums.push_back(u);
    Se.erase(it);
    for (int i = 0; i < mx; i++) {
      if (p[i]*u > 2 * n * n) {
        break;
      }
      Se.insert(p[i]*u);
    }
  }
  for (auto it : nums) {
    int div = 0;
    for (int i = 0; i < mx; i++) {
      div += (it % p[i]) == 0;
    }

      S.insert(PII(-div, it));
  }
  int cnt = 0;
  vector<int> ans;
  for (auto it : S) {
    cnt++;
    printf("%d%c", it.second, cnt == n ? '\n' : ' ');
    if (cnt == n) {
      break;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
#define esp 1e-14
#define inf 0x0f0f0f0f
#define in freopen("F:\\code\\data\\solve_in.txt", "r", stdin);
#define out freopen("F:\\code\\data\\solve_out.txt", "w", stdout);
#define bug(x) printf("Line: %d >>>>>>>>>>\n", (x));
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef map<PII, int> MPII;
const int maxn = 5000 * 5000 * 2 + 2;
int mx;

short vis[maxn];
int p[5] = {2, 3, 5, 7, 11};
set<PII> S;
vector<int> arr;
set<int> Se;
vector<int> nums;

int main() {
//  in
  int n;
  cin >> n;
  Se.insert(1);
  mx = 4;
  if (n > 2000) {
    mx = 5;
  }
  while (Se.size()) {
    auto it = Se.begin();
    int u = *it;
    nums.push_back(u);
    Se.erase(it);
    for (int i = 0; i < mx; i++) {
      if (p[i]*u > 2 * n * n) {
        break;
      }
//      cout << p[i]*u << endl;
      Se.insert(p[i]*u);
    }
  }
  for (auto it : nums) {
    int div = 0;
    for (int i = 0; i < mx; i++) {
      div += (it % p[i]) == 0;
    }
    if (div > 2 )
    S.insert(PII(-div, it));
  }
//  puts("1");
  int cnt = 0;
//  cout << S.begin()->first << endl;
//  cout << S.size() << endl;
//  return 0;
//  int c5 = 0;
  vector<int> ans;
  for (auto it : S) {
    cnt++;
//    c5 += it.first == -5;
     printf("%d%c", it.second, cnt == n ? '\n' : ' ');
    if (cnt == n) {
      break;
    }
  }
//  cout << c5 << endl;
  return 0;
}


#include <bits/stdc++.h>
#define esp 1e-14
#define inf 0x0f0f0f0f
#define in freopen("F:\\code\\data\\solve_in.txt", "r", stdin);
#define out freopen("F:\\code\\data\\solve_out.txt", "w", stdout);
#define bug(x) printf("Line: %d >>>>>>>>>>\n", (x));
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef map<PII, int> MPII;

const int maxn = 5000 * 5000 * 2 + 2;
int mx;
short vis[maxn];
int p[5] = {2, 3, 5, 7, 11};
set<PII> S;
vector<int> arr;
set<int> Se;
vector<int> nums;

int main() {
//  in
  int n;
  cin >> n;
  Se.insert(1);
  mx = 5
//  if (n > 2000) {
//    mx = 5;
//  }
  while (Se.size()) {
    auto it = Se.begin();
    int u = *it;
    nums.push_back(u);
    Se.erase(it);
    for (int i = 0; i < mx; i++) {
      if (p[i]*u > 2 * n * n) {
        break;
      }
      Se.insert(p[i]*u);
    }
  }
  for (auto it : nums) {
    int div = 0;
    for (int i = 0; i < mx; i++) {
      div += (it % p[i]) == 0;
    }
    if (div > 2 || n < 2000)
      S.insert(PII(-div, it));
  }
  int cnt = 0;
  vector<int> ans;
  for (auto it : S) {
    cnt++;
    printf("%d%c", it.second, cnt == n ? '\n' : ' ');
    if (cnt == n) {
      break;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
#define esp 1e-14
#define inf 0x0f0f0f0f
#define in freopen("F:\\code\\data\\solve_in.txt", "r", stdin);
#define out freopen("F:\\code\\data\\solve_out.txt", "w", stdout);
#define bug(x) printf("Line: %d >>>>>>>>>>\n", (x));
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef map<PII, int> MPII;
const int maxn = 5000*5000*2 + 2;

int vis[maxn];
int p[4] = {2, 3, 5, 7};
int a[maxn];

int main() {
//  in
  int n;
  cin >> n;
  for (int i = 0; i < 4; i++) {
    for (int j = p[i]; j <= 2*n*n; j += p[i]) {
      vis[j]++;
    }
  }
  for (int i = 1; i <= 2*n*n; i++) {
    a[i] = i;
  }
  sort(a+1, a+2*n*n+1, [] (const int& x, const int& y) {
    return vis[x] > vis[y];
  });
  for (int i = 1; i <= n; i++) {
    printf("%d%c", a[i], i == n ? '\n' : ' ');
  }
  return 0;
}


#include <bits/stdc++.h>
#define esp 1e-14
#define inf 0x0f0f0f0f
#define in freopen("F:\\code\\data\\solve_in.txt", "r", stdin);
#define out freopen("F:\\code\\data\\solve_out.txt", "w", stdout);
#define bug(x) printf("Line: %d >>>>>>>>>>\n", (x));
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef map<PII, int> MPII;
const int maxn = 5000*5000*2 + 2;

short vis[maxn];
int p[4] = {2, 3, 5, 7};
set<PII> S;

int main() {
//  in
  int n;
  cin >> n;
  for (int i = 0; i < 4; i++) {
    for (int j = p[i]; j <= 2*n*n; j += p[i]) {
      vis[j]++;
    }
  }
//  cout << vis[9] << endl;
  for (int i = 1; i <= 2*n*n; i++) {
    auto it = S.end();
    if (S.size()) {
      it--;
    }
    if (S.size() < n) {
      S.insert(PII(-vis[i], i));
    } else if (it->first > -vis[i]) {
      S.insert(PII(-vis[i], i));
    }
    if (S.size() > n) {
      it = S.end();
      it--;
      S.erase(it);
    }
  }
  int cnt = 0;
//  cout << S.size() << endl;
  for (auto it: S) {
    cnt++;
    printf("%d%c", it.second, cnt == n ? '\n' : ' ');
    if (cnt == n) {
      break;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
#define esp 1e-14
#define inf 0x0f0f0f0f
#define in freopen("F:\\code\\data\\solve_in.txt", "r", stdin);
#define out freopen("F:\\code\\data\\solve_out.txt", "w", stdout);
#define bug(x) printf("Line: %d >>>>>>>>>>\n", (x));
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef map<PII, int> MPII;
const int maxn = 5000 * 5000 * 2 + 2;

short vis[maxn];
const int mx = 5;
int p[mx] = {2, 3, 5, 7, 11};
set<PII> S;
vector<int> arr;
set<int> Se;
vector<int> nums;

int main() {
//  in
  int n;
  cin >> n;
  Se.insert(1);
  while (Se.size()) {
    auto it = Se.begin();
    int u = *it;
    nums.push_back(u);
    Se.erase(it);
    for (int i = 0; i < mx; i++) {
      if (p[i]*u > 2 * n * n) {
        break;
      }
//      cout << p[i]*u << endl;
      Se.insert(p[i]*u);
    }
  }
  for (auto it : nums) {
    int div = 0;
    for (int i = 0; i < mx; i++) {
      div += (it % p[i]) == 0;
    }
    S.insert(PII(-div, it));
  }
//  puts("1");
  int cnt = 0;
//  cout << S.size() << endl;
//  return 0;
  for (auto it : S) {
    cnt++;
    printf("%d%c", it.second, cnt == n ? '\n' : ' ');
    if (cnt == n) {
//      puts("");
      break;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
#define esp 1e-14
#define inf 0x0f0f0f0f
#define in freopen("F:\\code\\data\\solve_in.txt", "r", stdin);
#define out freopen("F:\\code\\data\\solve_out.txt", "w", stdout);
#define bug(x) printf("Line: %d >>>>>>>>>>\n", (x));
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef map<PII, int> MPII;
const int maxn = 5000 * 5000 * 2 + 2;
int mx;

short vis[maxn];
int p[5] = {2, 3, 5, 7, 11};
set<PII> S;
vector<int> arr;
set<int> Se;
vector<int> nums;

int main() {
//  in
  int n;
  cin >> n;
  Se.insert(1);
  mx = 4;
  if (n > 2000) {
    mx = 5;
  }
  while (Se.size()) {
    auto it = Se.begin();
    int u = *it;
    nums.push_back(u);
    Se.erase(it);
    for (int i = 0; i < mx; i++) {
      if (p[i]*u > 2 * n * n) {
        break;
      }
//      cout << p[i]*u << endl;
      Se.insert(p[i]*u);
    }
  }
  for (auto it : nums) {
    int div = 0;
    for (int i = 0; i < mx; i++) {
      div += (it % p[i]) == 0;
    }
    if (div > 2 || n < 2000)
    S.insert(PII(-div, it));
  }
//  puts("1");
  int cnt = 0;
//  cout << S.begin()->first << endl;
//  cout << S.size() << endl;
//  return 0;
//  int c5 = 0;
  vector<int> ans;
  for (auto it : S) {
    cnt++;
//    c5 += it.first == -5;
     printf("%d%c", it.second, cnt == n ? '\n' : ' ');
    if (cnt == n) {
      break;
    }
  }
//  cout << c5 << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int a[8] = {0,2,3,5,7,11,13,17};
int Max,s,ans[1000000],n,m;
int read(){
	int x = 0,f = 1, c= getchar();
	while (c<'0' || c>'9') {if (c=='-') f = -1;c = getchar();}
	while (c>='0' && c<='9') x = x*10+c-'0',c = getchar();
	return x*f;
}
void dfs(int t,int k) {
	if (t>m) {ans[++s] = k;return;}
	dfs(t+1,k);
	while (k*a[t]<=Max) {k*=a[t];dfs(t+1,k);}
}
int main(){
	n = read();
	Max = n*n*2;
	for (int i=2;i<=6;i++) {
		m = i;s = 0;
		dfs(1,1);
		if (s<2*n) continue;
		sort(ans,ans+s);
		for (int j=1;j<=n;j++) printf("%d ",ans[s-j]);
		return 0;
	}
}


#include<bits/stdc++.h>
using namespace std;
inline int read()
{
	int sign=1,sum=0;
	char c=getchar();
	while(!isdigit(c))
	{
		if (c=='-') sign=-1;
		c=getchar();
	}
	while(isdigit(c))
	{
		sum=(sum<<1)+(sum<<3)+c-'0';
		c=getchar();
	}
	return sign*sum;
}
#define read(x) x=read()
const int N=1e6+50;
int a[8]={0,2,3,5,7,11,13,17};
int n,m,ans[N],size,tmp;
inline void dfs(int u,int k)
{
	if (u>tmp)
	{
		ans[++size]=k;
		return;
	}
	dfs(u+1,k);
	while(a[u]*k<=m)
	  k*=a[u],dfs(u+1,k);
}
inline int cmp(int a,int b)
{
	return a>b;
}
int main()
{
	read(n);
	m=n*n<<1;
	for (int i=2;i<=6;++i)
	{
		tmp=i,size=0;
		dfs(1,1);
		if (size>=(n<<1))
		{
			sort(ans+1,ans+size+1,cmp);
			for (int i=1;i<=n;++i)
			  printf("%d ",ans[i]);
			break;
		}
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <numeric>
#include <bitset>
#include <cctype>
#include <list>
#include <assert.h>
#include <random>
typedef long long ll;
#define MAX 2505
using namespace std;
#define INF 2147483647
#define infL (1LL<<60)
#define inf (1<<30)
#define MOD 1000000007
#define EPS 1e-9
#define Gr 9.8
#define PI acos(-1)
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REQ(i,n) for(int (i)=1;(i)<=(int)(n);(i)++)
#define lch (rt<<1)
#define rch (rt<<1|1)
bool debug = 1;
int n,m, k;
//int dx[4] = {0,1,0,-1}, dy[4] = {1,0,-1,0};
ll ln, lk, lm;

char in[MAX];
int s[MAX][MAX], up[10],down[10];
ll ans;

int sum(int x1, int x2, int y1, int y2) {
    int z= s[x2][y2]-s[x2][y1]-s[x1][y2] + s[x1][y1];
    return z;
}
void dfs(int x1, int x2, int y1, int y2, bool fg) {
    if (x1==x2||y1==y2) return;
    if (x1+1==x2 && y1+1==y2) {
        ans += sum(x1, x2, y1, y2) == k; return;
    }
    if (fg) {
        int mid = (x1+x2)/2;
        dfs(x1, mid, y1, y2, 0); dfs(mid,x2,y1,y2,0);
        for(int i=y1;i<y2;i++) {
            up[0]=mid; down[0]=mid;
            REQ(x,k+1) {
                up[x]=x1; down[x]=x2;
            }
            for(int j=i+1;j<=y2;j++) {
                REQ(x,k+1) while(sum(up[x], mid, i, j)>=x) up[x]++;
                REQ(x,k+1) while(sum(mid,down[x], i, j)>=x) down[x]--;
                for(int x=0;x<=k;x++) {
                    ans += (up[x]-up[x+1]) * (down[k-x+1] - down[k-x]);
                }
            }
        }
    } else {
        int mid = (y1+y2)/2;
        dfs(x1,x2,y1,mid,1); dfs(x1,x2,mid,y2,1);
        for(int i=x1;i<x2;i++) {
            up[0]=mid; down[0]=mid;
            REQ(x,k+1) {
                up[x]=y1; down[x]=y2;
            }
            for(int j=i+1;j<=x2;j++) {
                REQ(x,k+1) while(sum(i,j,up[x], mid)>=x) up[x]++;
                REQ(x,k+1) while(sum(i,j,mid,down[x])>=x) down[x]--;
                for(int x=0;x<=k;x++) {
                    ans += (up[x]-up[x+1]) * (down[k-x+1] - down[k-x]);
                }
            }
        }
    }
}
int main(){
    scanf("%d%d%d", &n, &m, &k);
    REQ(i,n) {
        scanf("%s", in+1);
        REQ(j,m) {
            s[i][j] = s[i-1][j]+s[i][j-1]-s[i-1][j-1] + (in[j]-'0');
        }
    }
    dfs(0,n,0,m,0);
    printf("%lld\n", ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m,K,S[2510][2510],p1[10],p2[10];
ll ans;
char str[2510][2510];
inline int calc(int lx,int ly,int rx,int ry)
{
	return S[rx][ry]-S[lx-1][ry]-S[rx][ly-1]+S[lx-1][ly-1];
}
void solve(int lx,int ly,int rx,int ry,bool dir)
{
	if(lx>rx||ly>ry)return;
	if(lx==rx&&ly==ry)
	{
		ans+=(str[lx][ly]-'0')==K;
		return;
	}
	if(dir)
	{
		int mid=(ly+ry)/2;
		for(int l=lx;l<=rx;l++)
		{
			for(int j=0;j<=K;j++)p1[j]=ly,p2[j]=ry;
			for(int r=l;r<=rx;r++)
			{
				for(int i=0;i<=K;i++)
				{
					while(p1[i]<=mid&&calc(l,p1[i],r,mid)>i)p1[i]++;
					while(p2[i]>mid&&calc(l,mid+1,r,p2[i])>i)p2[i]--;
				}
				for(int i=0;i<=K;i++)
					ans+=(i?p1[i-1]-p1[i]:mid-p1[i]+1)*((K-i)?p2[K-i]-p2[K-i-1]:p2[K-i]-mid);
			}
		}
		solve(lx,ly,rx,mid,0);
		solve(lx,mid+1,rx,ry,0);
	}
	else
	{
		int mid=(lx+rx)/2;
		for(int l=ly;l<=ry;l++)
		{
			for(int j=0;j<=K;j++)p1[j]=lx,p2[j]=rx;
			for(int r=l;r<=ry;r++)
			{
				for(int i=0;i<=K;i++)
				{
					while(p1[i]<=mid&&calc(p1[i],l,mid,r)>i)p1[i]++;
					while(p2[i]>mid&&calc(mid+1,l,p2[i],r)>i)p2[i]--;
				}
				for(int i=0;i<=K;i++)
					ans+=(i?p1[i-1]-p1[i]:mid-p1[i]+1)*((K-i)?p2[K-i]-p2[K-i-1]:p2[K-i]-mid);
			}
		}
		solve(lx,ly,mid,ry,1);
		solve(mid+1,ly,rx,ry,1);
	}
}
int main()
{
	scanf("%d%d%d",&n,&m,&K);
	for(int i=1;i<=n;i++)
	{
		scanf("%s",str[i]+1);
		for(int j=1;j<=m;j++)S[i][j]=S[i-1][j]+S[i][j-1]-S[i-1][j-1]+(str[i][j]-'0');
	}
	solve(1,1,n,m,0);
	printf("%lld\n",ans);
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
using ll = long long;

const int N = 2505;

int n, m, num;
int a[N][N];
int sum[N][N];
int bestL[10], bestR[10];
ll ans;

int get(int lx, int rx, int ly, int ry) {
	if (lx > rx || ly > ry) {
		return 0;
	} else {
		return sum[rx][ry] - sum[lx - 1][ry] - sum[rx][ly - 1] + sum[lx - 1][ly - 1];
	}
}

void solve(int lx, int rx, int ly, int ry, int dir) {
	if (dir == 0) {
		if (lx == rx) {
			for (int i = ly; i <= ry; i++) {
				for (int j = i; j <= ry; j++) {
					if (get(lx, rx, i, j) == num) {
						ans++;
					}
				}
			}
			return;
		}
		int mid = (lx + rx) >> 1;
		for (int i = ly; i <= ry; i++) {
			for (int j = 0; j <= num + 1; j++) {
				bestL[j] = lx - 1;
				bestR[j] = rx + 1;
			}
			for (int j = i; j <= ry; j++) {
				for (int k = 0; k <= num + 1; k++) {
					while (bestL[k] + 1 <= mid && get(bestL[k] + 1, mid, i, j) >= k) {
						bestL[k]++;
					}
					while (bestR[k] - 1 > mid && get(mid + 1, bestR[k] - 1, i, j) >= k) {
						bestR[k]--;
					}
				}
				for (int k = 0; k <= num; k++) {
					if (bestL[k] >= lx && bestL[k] <= mid && get(bestL[k], mid, i, j) == k && bestR[num - k] >= mid + 1 && bestR[num - k] <= rx && get(mid + 1, bestR[num - k], i, j) == num - k) {
						ans += (bestL[k] - bestL[k + 1]) * (bestR[num - k + 1] - bestR[num - k]);
					}
				}
			}
		}
		solve(lx, mid, ly, ry, 1);
		solve(mid + 1, rx, ly, ry, 1);
	} else {
		if (ly == ry) {
			for (int i = lx; i <= rx; i++) {
				for (int j = i; j <= rx; j++) {
					if (get(i, j, ly, ry) == num) {
						ans++;
					}
				}
			}
			return;
		}
		int mid = (ly + ry) >> 1;
		for (int i = lx; i <= rx; i++) {
			for (int j = 0; j <= num + 1; j++) {
				bestL[j] = ly - 1;
				bestR[j] = ry + 1;
			}
			for (int j = i; j <= rx; j++) {
				for (int k = 0; k <= num + 1; k++) {
					while (bestL[k] + 1 <= mid && get(i, j, bestL[k] + 1, mid) >= k) {
						bestL[k]++;
					}
					while (bestR[k] - 1 >= mid + 1 && get(i, j, mid + 1, bestR[k] - 1) >= k) {
						bestR[k]--;
					}
				}
				for (int k = 0; k <= num; k++) {
					if (bestL[k] >= ly && bestL[k] <= mid && get(i, j, bestL[k], mid) == k && bestR[num - k] >= mid + 1 && bestR[num - k] <= ry && get(i, j, mid + 1, bestR[num - k]) == num - k) {
						ans += (bestL[k] - bestL[k + 1]) * (bestR[num - k + 1] - bestR[num - k]);
					}
				}
			}
		}
		solve(lx, rx, ly, mid, 0);
		solve(lx, rx, mid + 1, ry, 0);
	}
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);

	cin >> n >> m >> num;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			char c; cin >> c;
			a[i][j] = c - 48;
			sum[i][j] = sum[i - 1][j] + sum[i][j - 1] + a[i][j] - sum[i - 1][j - 1];
		}
	}

	solve(1, n, 1, m, 0);
	cout << ans;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define all(a) a.begin(), a.end()
#define db long double

int n, m, k;
bool a[2501][2501];
int sum[2501][2501];
ll ans = 0;

int get(int x1, int x2, int y1, int y2){
	return sum[x2][y2] - sum[x1 - 1][y2] - sum[x2][y1 - 1] + sum[x1 - 1][y1 - 1];
}

void solve(int x1, int y1, int x2, int y2){
	//cout << x1 << ' ' << y1 << ' ' << x2 << ' ' << y2 << endl;
	if (x1 == x2 && y1 == y2){
		ans += a[x1][y1] == k;
		return;
	}
	if (y2 - y1 > x2 - x1){
		int yy = (y2 + y1) >> 1;
		for (int c = 0; c <= k; c++){
			int c1 = c, c2 = k - c;
			for (int i = x1; i <= x2; i++){
				int l1 = y1, r1 = y1;
				int l2 = y2, r2 = y2;
				for (int j = i; j <= x2; j++){
					while(l1 <= yy && get(i, j, l1, yy) >= c1) l1++;
					while(r1 <= yy && get(i, j, r1, yy) > c1) r1++;
					if (r1 > yy) break;
					while(l2 > yy && get(i, j, yy + 1, l2) >= c2) l2--;
					while(r2 > yy && get(i, j, yy + 1, r2) > c2) r2--;
					if (r2 <= yy) break;
					ll w1 = 0, w2 = 0;
					if (get(i, j, r1, yy) == c1) w1 = l1 - r1;
					if (get(i, j, yy + 1, r2) == c2) w2 = r2 - l2;
					ans += w1 * w2;
				}
			}
		}
		solve(x1, y1, x2, yy);
		solve(x1, yy + 1, x2, y2);
	} else {
		int xx = (x1 + x2) >> 1;
		for (int c = 0; c <= k; c++){
			int c1 = c, c2 = k - c;
			for (int i = y1; i <= y2; i++){
				int l1 = x1, r1 = x1;
				int l2 = x2, r2 = x2;
				for (int j = i; j <= y2; j++){
					while(l1 <= xx && get(l1, xx, i, j) >= c1) l1++;
					while(r1 <= xx && get(r1, xx, i, j) > c1) r1++;
					if (r1 > xx) break;
					while(l2 > xx && get(xx + 1, l2, i, j) >= c2) l2--;
					while(r2 > xx && get(xx + 1, r2, i, j) > c2) r2--;
					if (r2 <= xx) break;
					ll w1 = 0, w2 = 0;
					if (get(r1, xx, i, j) == c1) w1 = l1 - r1;
					if (get(xx + 1, r2, i, j) == c2) w2 = r2 - l2;
					ans += w1 * w2;
				}
			}
		}
		solve(x1, y1, xx, y2);
		solve(xx + 1, y1, x2, y2);
	}
}

int main(){
    //freopen("input.txt", "r", stdin);
    //freopen("output1.txt", "w", stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n >> m >> k;
    for (int i = 1; i <= n; i++){
    	for (int j = 1; j <= m; j++){
    		char c;
    		cin >> c;
    		a[i][j] = c - '0';
    		sum[i][j] = a[i][j] + sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1];
    	}
    }

    solve(1, 1, n, m);

    cout << ans;
}


#include<bits/stdc++.h>
using namespace std;
int n,m,k;
string s;
int bound1[10],bound2[10];
bool graph[2501][2501];
int pre[2501][2501];
long long int ans=0;
int calc(int x1,int y1,int x2,int y2){
   return pre[x2][y2]-pre[x2][y1]-pre[x1][y2]+pre[x1][y1];
}
int cnt=0;
void solve(int x1,int y1,int x2,int y2,bool vertical){
   if(x1==x2||y1==y2)
      return;
   if(x2-x1==1&&y2-y1==1){
      ans+=(graph[x2][y2]==k);
      return;
   }
   if(vertical){
      int mid=(x1+x2)/2;
      solve(x1,y1,mid,y2,!vertical);
      solve(mid,y1,x2,y2,!vertical);
      bound1[0]=bound2[0]=mid;
      bound1[k+2]=x1;bound2[k+2]=x2;
      for(int i=y1;i<y2;i++){
         for(int j=i+1;j<=y2;j++){
            for(int kk=k+1;kk>0;kk--){
               if(j==i+1){
                  bound1[kk]=bound1[kk+1];
                  bound2[kk]=bound2[kk+1];
               }
               while(bound1[kk]<mid&&calc(bound1[kk],i,mid,j)>=kk)
                  bound1[kk]++;
               while(bound2[kk]>mid&&calc(mid,i,bound2[kk],j)>=kk)
                  bound2[kk]--;
            }
            for(int kk=0;kk<=k;kk++)
               ans+=(bound1[kk]-bound1[kk+1])*(bound2[k-kk+1]-bound2[k-kk]);
         }
      }
   }else{
      int mid=(y1+y2)/2;
      solve(x1,y1,x2,mid,!vertical);
      solve(x1,mid,x2,y2,!vertical);
      bound1[0]=bound2[0]=mid;
      bound1[k+2]=y1;bound2[k+2]=y2;
      for(int i=x1;i<x2;i++){
         for(int j=i+1;j<=x2;j++){
            for(int kk=k+1;kk>0;kk--){
               if(j==i+1){
                  bound1[kk]=bound1[kk+1];
                  bound2[kk]=bound2[kk+1];
               }
               while(bound1[kk]<mid&&calc(i,bound1[kk],j,mid)>=kk)
                  bound1[kk]++;
               while(bound2[kk]>mid&&calc(i,mid,j,bound2[kk])>=kk)
                  bound2[kk]--;
            }
            for(int kk=0;kk<=k;kk++){
               ans+=(bound1[kk]-bound1[kk+1])*(bound2[k-kk+1]-bound2[k-kk]);
            }

         }
      }
   }
}
int main(){
   ios_base::sync_with_stdio(0);
   cin.tie(0);
   cin>>n>>m>>k;
   for(int i=1;i<=n;i++){
      cin>>s;
      for(int j=1;j<=m;j++)
         graph[i][j]=(s[j-1]=='1');
   }
   for(int i=1;i<=n;i++)
      for(int j=1;j<=m;j++)
         pre[i][j]=pre[i-1][j]+pre[i][j-1]-pre[i-1][j-1]+graph[i][j];
   solve(0,0,n,m,0);
   cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int n,m,k;
string s;
int bound1[10],bound2[10];
bool graph[2501][2501];
int pre[2501][2501];
long long int ans=0;
int calc(int x1,int y1,int x2,int y2){
   return pre[x2][y2]-pre[x2][y1]-pre[x1][y2]+pre[x1][y1];
}
void solve(int x1,int y1,int x2,int y2,bool vertical){
   if(x1==x2||y1==y2)
      return;
   if(x2-x1==1&&y2-y1==1){
      ans+=(graph[x2][y2]==k);
      return;
   }
   if(vertical){
      int mid=(x1+x2)/2;
      solve(x1,y1,mid,y2,!vertical);
      solve(mid,y1,x2,y2,!vertical);
      for(int i=y1;i<y2;i++){
         bound1[0]=bound2[0]=mid;
         bound1[k+2]=x1;bound2[k+2]=x2;
         for(int j=i+1;j<=y2;j++){
            for(int kk=k+1;kk>0;kk--){
               bound1[kk]=bound1[kk+1];
               bound2[kk]=bound2[kk+1];
               while(bound1[kk]<mid&&calc(bound1[kk],i,mid,j)>=kk)
                  bound1[kk]++;
               while(bound2[kk]>mid&&calc(mid,i,bound2[kk],j)>=kk)
                  bound2[kk]--;
            }
            for(int kk=0;kk<=k;kk++)
               ans+=(bound1[kk]-bound1[kk+1])*(bound2[k-kk+1]-bound2[k-kk]);
         }
      }
   }else{
      int mid=(y1+y2)/2;
      solve(x1,y1,x2,mid,!vertical);
      solve(x1,mid,x2,y2,!vertical);
      for(int i=x1;i<x2;i++){
         bound1[0]=bound2[0]=mid;
         bound1[k+2]=y1;bound2[k+2]=y2;
         for(int j=i+1;j<=x2;j++){
            for(int kk=k+1;kk>0;kk--){
               bound1[kk]=bound1[kk+1];
               bound2[kk]=bound2[kk+1];
               while(bound1[kk]<mid&&calc(i,bound1[kk],j,mid)>=kk)
                  bound1[kk]++;
               while(bound2[kk]>mid&&calc(i,mid,j,bound2[kk])>=kk)
                  bound2[kk]--;
            }
            // cout<<x1<<' '<<y1<<' '<<x2<<' '<<y2<<' '<<i<<' '<<j<<endl;
            for(int kk=0;kk<=k;kk++){
               // cout<<bound1[kk]<<' '<<bound2[kk]<<endl;
               ans+=(bound1[kk]-bound1[kk+1])*(bound2[k-kk+1]-bound2[k-kk]);
            }

         }
      }
   }
}
int main(){
   ios_base::sync_with_stdio(0);
   cin.tie(0);
   cin>>n>>m>>k;
   for(int i=1;i<=n;i++){
      cin>>s;
      for(int j=1;j<=m;j++)
         graph[i][j]=(s[j-1]=='1');
   }
   for(int i=1;i<=n;i++)
      for(int j=1;j<=m;j++)
         pre[i][j]=pre[i-1][j]+pre[i][j-1]-pre[i-1][j-1]+graph[i][j];
   solve(0,0,n,m,0);
   cout<<ans<<endl;

}


// In the name of Allah.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2500 + 14;
int n, m, k;
char c[maxn][maxn];
int up[maxn][maxn], dn[maxn][maxn];
int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n >> m >> k;
    for(int i = 0; i < n; i++){
    	cin >> c[i];
    	for(int j = 0; j < m; j++)
    		up[i][j] = i == 0 || c[i - 1][j] == '1' ? i - 1 : up[i - 1][j];
    }
    fill(dn[n], dn[n] + m, n);
    for(int i = n - 1; i >= 0; i--)
    	for(int j = 0; j < m; j++)
    		dn[i][j] = c[i][j] == '1' ? i : dn[i + 1][j];
    int ans = 0;
    for(int i = 0; i < n; i++){
    	vector<pair<int, int>> ord;
    	map<int, pair<int, int>> data;
    	for(int j = 0; j < m; j++)
    		for(int cnt = 0, curr = c[i][j] == '1' ? i : up[i][j]; cnt <= k; cnt++, curr = up[curr][j]){
    			data[j] = {cnt + 1, curr + 1};
    			// if(curr < i)
    				ord.push_back({curr + 1, j});
    			if(curr == -1)
    				break;
    		}
    	// cerr << data[1].first << '\n';
    	sort(ord.begin(), ord.end());
    	for_each(ord.begin(), ord.end(), [&i, &data, &ans](pair<int, int> tmp){
    		auto [ni, j] = tmp;
    		// cerr << ni << ' ' << j << ":\n";
    		auto it = data.find(j);
    		assert(it != data.end());
    		assert(it -> second.second == ni);
    		it -> second.first--;
    		it -> second.second = dn[it -> second.second][j] + 1;
    		int cntl = 0, mnh = i + 1;
    		for(auto lit = it; cntl <= k; ){
    			bool isb = lit == data.begin();
    			auto prv = isb ? data.end() : prev(lit);
    			int lprv = isb ? -1 : prv -> first;
    			int cntr = 0, mnrh = i + 1;
    			for(auto rit = it; rit != data.end(); rit++){
    				cntr += rit -> second.first -
    				(rit -> second.second && rit -> second.second == ni && c[rit -> second.second - 1][rit -> first] == '1');
	    			mnrh = min(mnrh, rit -> second.second);
    				if(cntl + cntr > k)
    					break;
    				// cerr << "c "<< lit -> first << ' ' << rit -> first << ' ' << cntl << ' ' << cntr << '\n';
    				if(cntl + cntr == k){
	    				int rnxt = next(rit) == data.end() ? m : next(rit) -> first;
	    				if(ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first)){
				    		// for(auto [j, d] : data)
				    		// 	cerr << j << " : " << d.first << ' ' << d.second << '\n';
	    					// cerr << i << ' ' << min(mnh, mnrh) << ' ' << ni << ' ' << lit -> first << ' ' << lprv << ' ' << rnxt << ' ' << rit -> first
	    					// << " cnt: " << cntl << ' ' << cntr << '\n';
	    				}
	    				assert(min(mnh, mnrh) - ni >= 0);
	    				ans += max(0ll, ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first));
	    			}
    			}
    			if(isb)
    				break;
    			lit = prv;
    			cntl += lit -> second.first;
    			mnh = min(mnh, lit -> second.second);
    		}
    		if(it -> second.first == 0)
    			data.erase(it);
    	});
    }
    cout << ans << '\n';
}


// In the name of Allah.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2500 + 14;
int n, m, k;
char c[maxn][maxn], up[maxn][maxn], dn[maxn][maxn];
int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n >> m >> k;
    for(int i = 0; i < n; i++){
    	cin >> c[i];
    	for(int j = 0; j < m; j++)
    		up[i][j] = i == 0 || c[i - 1][j] == '1' ? i - 1 : up[i - 1][j];
    }
    fill(dn[n], dn[n] + m, n);
    for(int i = n - 1; i >= 0; i--)
    	for(int j = 0; j < m; j++)
    		dn[i][j] = c[i][j] == '1' ? i : dn[i + 1][j];
    int ans = 0;
    for(int i = 0; i < n; i++){
    	vector<pair<int, int>> ord;
    	map<int, pair<int, int>> data;
    	for(int j = 0; j < m; j++)
    		for(int cnt = 0, curr = c[i][j] == '1' ? i : up[i][j]; cnt <= k; cnt++, curr = up[curr][j]){
    			data[j] = {cnt + 1, curr + 1};
    			if(curr < i)
    				ord.push_back({curr + 1, j});
    			if(curr == -1)
    				break;
    		}
    	// cerr << data[1].first << '\n';
    	sort(ord.begin(), ord.end());
    	for_each(ord.begin(), ord.end(), [&i, &data, &ans](pair<int, int> tmp){
    		auto [ni, j] = tmp;
    		// cerr << ni << ' ' << j << ":\n";
    		auto it = data.find(j);
    		it -> second.first--;
    		it -> second.second = dn[it -> second.second][j] + 1;
    		int cntl = 0, mnh = i + 1;
    		for(auto lit = it; cntl <= k; ){
    			bool isb = lit == data.begin();
    			auto prv = isb ? data.end() : prev(lit);
    			int lprv = isb ? -1 : prv -> first;
    			int cntr = 0, mnrh = i + 1;
    			for(auto rit = it; rit != data.end(); rit++){
    				cntr += rit -> second.first -
    				(rit -> second.second && rit -> second.second == ni && c[rit -> second.second - 1][rit -> first] == '1');
	    			mnrh = min(mnrh, rit -> second.second);
    				if(cntl + cntr > k)
    					break;
    				// cerr << "c "<< lit -> first << ' ' << rit -> first << ' ' << cntl << ' ' << cntr << '\n';
    				if(cntl + cntr == k){
	    				int rnxt = next(rit) == data.end() ? m : next(rit) -> first;
	    				if(ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first)){
				    		// for(auto [j, d] : data)
				    		// 	cerr << j << " : " << d.first << ' ' << d.second << '\n';
	    					// cerr << i << ' ' << min(mnh, mnrh) << ' ' << ni << ' ' << lit -> first << ' ' << lprv << ' ' << rnxt << ' ' << rit -> first
	    					// << " cnt: " << cntl << ' ' << cntr << '\n';
	    				}
	    				assert(min(mnh, mnrh) - ni >= 0);
	    				ans += ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first);
	    			}
    			}
    			if(isb)
    				break;
    			lit = prv;
    			cntl += lit -> second.first;
    			mnh = min(mnh, lit -> second.second);
    		}
    		if(it -> second.first == 0)
    			data.erase(it);
    	});
    }
    cout << ans << '\n';
}


// In the name of Allah.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2500 + 14;
int n, m, k;
char c[maxn][maxn];
int up[maxn][maxn], dn[maxn][maxn];
int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n >> m >> k;
    for(int i = 0; i < n; i++){
    	cin >> c[i];
    	for(int j = 0; j < m; j++)
    		up[i][j] = i == 0 || c[i - 1][j] == '1' ? i - 1 : up[i - 1][j];
    }
    fill(dn[n], dn[n] + m, n);
    for(int i = n - 1; i >= 0; i--)
    	for(int j = 0; j < m; j++)
    		dn[i][j] = c[i][j] == '1' ? i : dn[i + 1][j];
    ll ans = 0;
    for(int i = 0; i < n; i++){
    	vector<pair<int, int>> ord;
    	map<int, pair<int, int>> data;
    	for(int j = 0; j < m; j++){
    		auto &dataj = data[j];
    		for(int cnt = 0, curr = c[i][j] == '1' ? i : up[i][j]; cnt <= k; cnt++, curr = up[curr][j]){
    			dataj = {cnt + 1, curr + 1};
    			if(curr < i)
    				ord.push_back({curr + 1, j});
    			if(curr == -1)
    				break;
    		}
    	}
    	// cerr << data[1].first << '\n';
    	sort(ord.begin(), ord.end());
    	for_each(ord.begin(), ord.end(), [&i, &data, &ans](pair<int, int> tmp){
    		auto [ni, j] = tmp;
    		// cerr << ni << ' ' << j << ":\n";
    		auto it = data.find(j);
    		// assert(it != data.end());
    		// assert(it -> second.second == ni);
    		it -> second.first--;
    		it -> second.second = dn[it -> second.second][j] + 1;
    		int cntl = 0, mnh = i + 1;
    		for(auto lit = it; cntl <= k; ){
    			bool isb = lit == data.begin();
    			auto prv = isb ? data.end() : prev(lit);
    			int lprv = isb ? -1 : prv -> first;
    			int cntr = 0, mnrh = i + 1;
    			for(auto rit = it; rit != data.end(); rit++){
    				cntr += rit -> second.first -
    				(rit -> second.second && rit -> second.second == ni && c[rit -> second.second - 1][rit -> first] == '1');
	    			mnrh = min(mnrh, rit -> second.second);
    				if(cntl + cntr > k)
    					break;
    				// cerr << "c "<< lit -> first << ' ' << rit -> first << ' ' << cntl << ' ' << cntr << '\n';
    				if(cntl + cntr == k){
	    				int rnxt = next(rit) == data.end() ? m : next(rit) -> first;
	    				if(ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first)){
				    		// for(auto [j, d] : data)
				    		// 	cerr << j << " : " << d.first << ' ' << d.second << '\n';
	    					// cerr << i << ' ' << min(mnh, mnrh) << ' ' << ni << ' ' << lit -> first << ' ' << lprv << ' ' << rnxt << ' ' << rit -> first
	    					// << " cnt: " << cntl << ' ' << cntr << '\n';
	    				}
	    				// assert(min(mnh, mnrh) - ni >= 0);
	    				ans += ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first);
	    			}
    			}
    			if(isb)
    				break;
    			lit = prv;
    			cntl += lit -> second.first;
    			mnh = min(mnh, lit -> second.second);
    		}
    		if(it -> second.first == 0)
    			data.erase(it);
    	});
    }
    cout << ans << '\n';
}


// In the name of Allah.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2500 + 14;
int n, m, k;
char c[maxn][maxn], up[maxn][maxn], dn[maxn][maxn];
int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n >> m >> k;
    for(int i = 0; i < n; i++){
    	cin >> c[i];
    	for(int j = 0; j < m; j++)
    		up[i][j] = i == 0 || c[i - 1][j] == '1' ? i - 1 : up[i - 1][j];
    }
    fill(dn[n], dn[n] + m, n);
    for(int i = n - 1; i >= 0; i--)
    	for(int j = 0; j < m; j++)
    		dn[i][j] = c[i][j] == '1' ? i : dn[i + 1][j];
    int ans = 0;
    for(int i = 0; i < n; i++){
    	vector<pair<int, int>> ord;
    	map<int, pair<int, int>> data;
    	for(int j = 0; j < m; j++)
    		for(int cnt = 0, curr = c[i][j] == '1' ? i : up[i][j]; cnt <= k; cnt++, curr = up[curr][j]){
    			data[j] = {cnt + 1, curr + 1};
    			if(curr < i)
    				ord.push_back({curr + 1, j});
    			if(curr == -1)
    				break;
    		}
    	// cerr << data[1].first << '\n';
    	sort(ord.begin(), ord.end());
    	for_each(ord.begin(), ord.end(), [&i, &data, &ans](pair<int, int> tmp){
    		auto [ni, j] = tmp;
    		// cerr << ni << ' ' << j << ":\n";
    		auto it = data.find(j);
    		it -> second.first--;
    		it -> second.second = dn[it -> second.second][j] + 1;
    		int cntl = 0, mnh = i + 1;
    		for(auto lit = it; cntl <= k; ){
    			bool isb = lit == data.begin();
    			auto prv = isb ? data.end() : prev(lit);
    			int lprv = isb ? -1 : prv -> first;
    			int cntr = 0, mnrh = i + 1;
    			for(auto rit = it; rit != data.end(); rit++){
    				cntr += rit -> second.first -
    				(rit -> second.second && rit -> second.second == ni && c[rit -> second.second - 1][rit -> first] == '1');
	    			mnrh = min(mnrh, rit -> second.second);
    				if(cntl + cntr > k)
    					break;
    				// cerr << "c "<< lit -> first << ' ' << rit -> first << ' ' << cntl << ' ' << cntr << '\n';
    				if(cntl + cntr == k){
	    				int rnxt = next(rit) == data.end() ? m : next(rit) -> first;
	    				if(ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first)){
				    		// for(auto [j, d] : data)
				    		// 	cerr << j << " : " << d.first << ' ' << d.second << '\n';
	    					// cerr << i << ' ' << min(mnh, mnrh) << ' ' << ni << ' ' << lit -> first << ' ' << lprv << ' ' << rnxt << ' ' << rit -> first
	    					// << " cnt: " << cntl << ' ' << cntr << '\n';
	    				}
	    				// assert(min(mnh, mnrh) - ni >= 0);
	    				ans += ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first);
	    			}
    			}
    			if(isb)
    				break;
    			lit = prv;
    			cntl += lit -> second.first;
    			mnh = min(mnh, lit -> second.second);
    		}
    		if(it -> second.first == 0)
    			data.erase(it);
    	});
    }
    cout << ans << '\n';
}


// In the name of Allah.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2500 + 14;
int n, m, k;
char c[maxn][maxn];
int up[maxn][maxn], dn[maxn][maxn];
int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n >> m >> k;
    for(int i = 0; i < n; i++){
    	cin >> c[i];
    	for(int j = 0; j < m; j++)
    		up[i][j] = i == 0 || c[i - 1][j] == '1' ? i - 1 : up[i - 1][j];
    }
    fill(dn[n], dn[n] + m, n);
    for(int i = n - 1; i >= 0; i--)
    	for(int j = 0; j < m; j++)
    		dn[i][j] = c[i][j] == '1' ? i : dn[i + 1][j];
    int ans = 0;
    for(int i = 0; i < n; i++){
    	vector<pair<int, int>> ord;
    	map<int, pair<int, int>> data;
    	for(int j = 0; j < m; j++)
    		for(int cnt = 0, curr = c[i][j] == '1' ? i : up[i][j]; cnt <= k; cnt++, curr = up[curr][j]){
    			data[j] = {cnt + 1, curr + 1};
    			// if(curr < i)
    				ord.push_back({curr + 1, j});
    			if(curr == -1)
    				break;
    		}
    	// cerr << data[1].first << '\n';
    	sort(ord.begin(), ord.end());
    	for_each(ord.begin(), ord.end(), [&i, &data, &ans](pair<int, int> tmp){
    		auto [ni, j] = tmp;
    		// cerr << ni << ' ' << j << ":\n";
    		auto it = data.find(j);
    		// assert(it != data.end());
    		// assert(it -> second.second == ni);
    		it -> second.first--;
    		it -> second.second = dn[it -> second.second][j] + 1;
    		int cntl = 0, mnh = i + 1;
    		for(auto lit = it; cntl <= k; ){
    			bool isb = lit == data.begin();
    			auto prv = isb ? data.end() : prev(lit);
    			int lprv = isb ? -1 : prv -> first;
    			int cntr = 0, mnrh = i + 1;
    			for(auto rit = it; rit != data.end(); rit++){
    				cntr += rit -> second.first -
    				(rit -> second.second && rit -> second.second == ni && c[rit -> second.second - 1][rit -> first] == '1');
	    			mnrh = min(mnrh, rit -> second.second);
    				if(cntl + cntr > k)
    					break;
    				// cerr << "c "<< lit -> first << ' ' << rit -> first << ' ' << cntl << ' ' << cntr << '\n';
    				if(cntl + cntr == k){
	    				int rnxt = next(rit) == data.end() ? m : next(rit) -> first;
	    				if(ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first)){
				    		// for(auto [j, d] : data)
				    		// 	cerr << j << " : " << d.first << ' ' << d.second << '\n';
	    					// cerr << i << ' ' << min(mnh, mnrh) << ' ' << ni << ' ' << lit -> first << ' ' << lprv << ' ' << rnxt << ' ' << rit -> first
	    					// << " cnt: " << cntl << ' ' << cntr << '\n';
	    				}
	    				assert(min(mnh, mnrh) - ni >= 0);
	    				ans += max(0ll, ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first));
	    			}
    			}
    			if(isb)
    				break;
    			lit = prv;
    			cntl += lit -> second.first;
    			mnh = min(mnh, lit -> second.second);
    		}
    		if(it -> second.first == 0)
    			data.erase(it);
    	});
    }
    cout << ans << '\n';
}


// In the name of Allah.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2500 + 14;
int n, m, k;
char c[maxn][maxn], up[maxn][maxn], dn[maxn][maxn];
int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n >> m >> k;
    for(int i = 0; i < n; i++){
    	cin >> c[i];
    	for(int j = 0; j < m; j++)
    		up[i][j] = i == 0 || c[i - 1][j] == '1' ? i - 1 : up[i - 1][j];
    }
    fill(dn[n], dn[n] + m, n);
    for(int i = n - 1; i >= 0; i--)
    	for(int j = 0; j < m; j++)
    		dn[i][j] = c[i][j] == '1' ? i : dn[i + 1][j];
    int ans = 0;
    for(int i = 0; i < n; i++){
    	vector<pair<int, int>> ord;
    	map<int, pair<int, int>> data;
    	for(int j = 0; j < m; j++)
    		for(int cnt = 0, curr = c[i][j] == '1' ? i : up[i][j]; cnt <= k; cnt++, curr = up[curr][j]){
    			data[j] = {cnt + 1, curr + 1};
    			if(curr < i)
    				ord.push_back({curr + 1, j});
    			if(curr == -1)
    				break;
    		}
    	// cerr << data[1].first << '\n';
    	sort(ord.begin(), ord.end());
    	for_each(ord.begin(), ord.end(), [&i, &data, &ans](pair<int, int> tmp){
    		auto [ni, j] = tmp;
    		// cerr << ni << ' ' << j << ":\n";
    		auto it = data.find(j);
    		it -> second.first--;
    		it -> second.second = dn[it -> second.second][j] + 1;
    		int cntl = 0, mnh = i + 1;
    		for(auto lit = it; cntl <= k; ){
    			bool isb = lit == data.begin();
    			auto prv = isb ? data.end() : prev(lit);
    			int lprv = isb ? -1 : prv -> first;
    			int cntr = 0, mnrh = i + 1;
    			for(auto rit = it; rit != data.end(); rit++){
    				cntr += rit -> second.first -
    				(rit -> second.second && rit -> second.second == ni && c[rit -> second.second - 1][rit -> first] == '1');
	    			mnrh = min(mnrh, rit -> second.second);
    				if(cntl + cntr > k)
    					break;
    				// cerr << "c "<< lit -> first << ' ' << rit -> first << ' ' << cntl << ' ' << cntr << '\n';
    				if(cntl + cntr == k){
	    				int rnxt = next(rit) == data.end() ? m : next(rit) -> first;
	    				if(ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first)){
				    		// for(auto [j, d] : data)
				    		// 	cerr << j << " : " << d.first << ' ' << d.second << '\n';
	    					// cerr << i << ' ' << min(mnh, mnrh) << ' ' << ni << ' ' << lit -> first << ' ' << lprv << ' ' << rnxt << ' ' << rit -> first
	    					// << " cnt: " << cntl << ' ' << cntr << '\n';
	    				}
	    				// assert(min(mnh, mnrh) - ni >= 0);
	    				ans += max(0ll, ll(min(mnh, mnrh) - ni) * (lit -> first - lprv) * (rnxt - rit -> first));
	    			}
    			}
    			if(isb)
    				break;
    			lit = prv;
    			cntl += lit -> second.first;
    			mnh = min(mnh, lit -> second.second);
    		}
    		if(it -> second.first == 0)
    			data.erase(it);
    	});
    }
    cout << ans << '\n';
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long long unsigned llu;
typedef long double ld;

const int inf = 0x3c3c3c3c;
const ll infl = 0x3c3c3c3c3c3c3c3c;

void process(vector<pair<int, int>> &num, bool flag){
	if(num.size() == 0){
		if(flag) printf("0\n");
		return;
	}
	if(num.size() == 1){
		printf("pushStack\n");
		if(flag) printf("1 popStack\n");
		return;
	}
	if(num.size() == 2){
		printf("pushStack\n");
		printf("pushQueue\n");
		if(flag) printf("2 popStack popQueue\n");
		return;
	}
	sort(num.begin(), num.end());
	int n = num.size();
	int p[3] = {num[n - 1].second, num[n - 2].second, num[n - 3].second};
	sort(num.begin(), num.end(), [](const pair<int, int> &a, const pair<int, int> &b){
		if(a.second != b.second) return a.second < b.second;
		return a.first < b.first;
	});
	int state = 0;
	for(int i = 0; i < n; i++){
		int currP = num[i].second;
		if(currP == p[0] || currP == p[1] || currP == p[2]){
			if(state == 0){
				printf("pushStack\n");
				state++;
			}
			else if(state == 1){
				printf("pushBack\n");
				state++;
			}
			else if(state == 2){
				printf("pushQueue\n");
				state++;
			}
		}
		else{
			if(state == 0) printf("pushStack\n");
			else if(state == 1) printf("pushBack\n");
			else printf("pushFront\n");
		}
	}
	if(flag) printf("3 popStack popQueue popBack\n");
}

int main(){
	cin.tie(NULL);
	cin.sync_with_stdio(false);
	cout.sync_with_stdio(false);
	int n;
	cin >> n;
	vector<pair<int, int>> num;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		if(a){
			num.push_back({a, (int)num.size()});
		}
		else{
			process(num, true);
			num.clear();
		}
	}
	process(num, false);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long long unsigned llu;
typedef long double ld;

const int inf = 0x3c3c3c3c;
const ll infl = 0x3c3c3c3c3c3c3c3c;

void process(vector<pair<int, int>> &num, bool flag){
	if(num.size() == 0){
		printf("0\n");
		return;
	}
	if(num.size() == 1){
		printf("pushStack\n");
		if(flag) printf("1 popStack\n");
		return;
	}
	if(num.size() == 2){
		printf("pushStack\n");
		printf("pushQueue\n");
		if(flag) printf("2 popStack popQueue\n");
		return;
	}
	sort(num.begin(), num.end());
	int n = num.size();
	int p[3] = {num[n - 1].second, num[n - 2].second, num[n - 3].second};
	sort(num.begin(), num.end(), [](const pair<int, int> &a, const pair<int, int> &b){
		if(a.second != b.second) return a.second < b.second;
		return a.first < b.first;
	});
	int state = 0;
	for(int i = 0; i < n; i++){
		int currP = num[i].second;
		if(currP == p[0] || currP == p[1] || currP == p[2]){
			if(state == 0){
				printf("pushStack\n");
				state++;
			}
			else if(state == 1){
				printf("pushBack\n");
				state++;
			}
			else if(state == 2){
				printf("pushQueue\n");
				state++;
			}
		}
		else{
			if(state == 0) printf("pushStack\n");
			else if(state == 1) printf("pushBack\n");
			else printf("pushFront\n");
		}
	}
	if(flag) printf("3 popStack popQueue popBack\n");
}

int main(){
	cin.tie(NULL);
	cin.sync_with_stdio(false);
	cout.sync_with_stdio(false);
	int n;
	cin >> n;
	vector<pair<int, int>> num;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		if(a){
			num.push_back({a, (int)num.size()});
		}
		else{
			process(num, true);
			num.clear();
		}
	}
	process(num, false);
	return 0;
}


#include<bits/stdc++.h>
#define endl "\n"
#define pb push_back
#define ll long long
#define d1(x)  cerr << #x << "--> " << x << endl
#define d2(x,y)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<endl
#define d3(x,y,z)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z<< endl
#define d4(x,y,z,w)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z << " | "<< #w << "--> " << w <<endl
#define vpll vector<pair<ll,ll>>
#define F first
#define S second
#define T ll tt; cin>>tt; while(tt--)
using namespace std;
ll mode=1e9+7;
const long long maxn=8001;
const long long inf=99999999999;
ll lcm(ll a, ll b){ return (a*b)/__gcd(a,b); }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll getRand(ll l, ll r){ uniform_int_distribution<ll> uid(l, r); return uid(rng); }

ll power(ll x, ll y){
	ll p=mode, res=1;
    x = x % p;
    while (y > 0) {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

void solve(){

	ll n;
	cin>>n;
	vector<ll> v(n);
	for (int i=0;i<n;i++) cin>>v[i];

	ll r=0;
	while(r<n){
		vector<ll> v2;
		vector<string> vs;
		while(r<n && v[r]!=0){
			v2.pb(v[r]);
			r++;
		}
		sort(v2.rbegin(), v2.rend());
		if (v2.size()==0){
			if (r<n && v[r]==0) cout<<0<<endl;
		}
		else if (v2.size()==1){
			cout<<"pushStack"<<endl;
			if (r<n && v[r]==0) cout<<1<<" "<<"popStack"<<endl;
		}
		else if (v2.size()==2){
			cout<<"pushStack"<<endl;
			cout<<"pushQueue"<<endl;
			if (r<n && v[r]==0) cout<<2<<" "<<"popStack "<<"popQueue"<<endl;
		}
		else if (v2.size()==3){
			cout<<"pushStack"<<endl;
			cout<<"pushQueue"<<endl;
			cout<<"pushFront"<<endl;
			if (r<n && v[r]==0) cout<<3<<" "<<"popStack "<<"popQueue "<<"popFront"<<endl;
		}
		else{
			cout<<"pushStack"<<endl;
			cout<<"pushQueue"<<endl;
			cout<<"pushFront"<<endl;
			for (int j=4;j<=v2.size();j++) cout<<"pushBack"<<endl;
			if (r<n && v[r]==0) cout<<3<<" "<<"popStack "<<"popQueue "<<"popFront"<<endl;
		}
		r++;
	}

	return;
}

int main(){

    #ifndef ONLINE_JUDGE
		//freopen("input.txt", "r", stdin);
    #endif
    srand(time(0));

    ios::sync_with_stdio(0);
    cin.tie(0);

	//T{ solve(); }
	solve();

	return 0;
}


#include<bits/stdc++.h>
#define endl "\n"
#define pb push_back
#define ll long long
#define d1(x)  cerr << #x << "--> " << x << endl
#define d2(x,y)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<endl
#define d3(x,y,z)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z<< endl
#define d4(x,y,z,w)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z << " | "<< #w << "--> " << w <<endl
#define vpll vector<pair<ll,ll>>
#define F first
#define S second
#define T ll tt; cin>>tt; while(tt--)
using namespace std;
ll mode=1e9+7;
const long long maxn=8001;
const long long inf=99999999999;
ll lcm(ll a, ll b){ return (a*b)/__gcd(a,b); }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll getRand(ll l, ll r){ uniform_int_distribution<ll> uid(l, r); return uid(rng); }

ll power(ll x, ll y){
	ll p=mode, res=1;
    x = x % p;
    while (y > 0) {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

void solve(){

	ll n;
	cin>>n;
	vector<ll> v(n);
	for (int i=0;i<n;i++) cin>>v[i];

	ll r=0;
	while(r<n){
		vpll v2;
		while(r<n && v[r]!=0){
			v2.pb({v[r], r});
			r++;
		}
		sort(v2.rbegin(), v2.rend());
		if (v2.size()==0){
			if (r<n && v[r]==0) cout<<0<<endl;
		}
		else if (v2.size()==1){
			cout<<"pushStack"<<endl;
			if (r<n && v[r]==0) cout<<1<<" "<<"popStack"<<endl;
		}
		else if (v2.size()==2){
			cout<<"pushStack"<<endl;
			cout<<"pushQueue"<<endl;
			if (r<n && v[r]==0) cout<<2<<" "<<"popStack "<<"popQueue"<<endl;
		}
		else if (v2.size()==3){
			cout<<"pushStack"<<endl;
			cout<<"pushQueue"<<endl;
			cout<<"pushFront"<<endl;
			if (r<n && v[r]==0) cout<<3<<" "<<"popStack "<<"popQueue "<<"popFront"<<endl;
		}
		else{
			bool st=false, qu=false, dq=false;
			for (int j=0;j<v2.size();j++){
				if (j==v2[0].S || j==v2[1].S || j==v2[2].S){
					if (st==false){
						st=true;
						cout<<"pushStack"<<endl;
					}
					else if (qu==false){
						qu=true;
						cout<<"pushQueue"<<endl;
					}
					else if (dq==false){
						dq=true;
						cout<<"pushFront"<<endl;
					}
				}
				else{
					cout<<"pushBack"<<endl;
				}
			}

			if (r<n && v[r]==0) cout<<3<<" "<<"popStack "<<"popQueue "<<"popFront"<<endl;
		}
		r++;
	}

	return;
}

int main(){

    #ifndef ONLINE_JUDGE
		//freopen("input.txt", "r", stdin);
    #endif
    srand(time(0));

    ios::sync_with_stdio(0);
    cin.tie(0);

	//T{ solve(); }
	solve();

	return 0;
}


#include<bits/stdc++.h>
#define endl "\n"
#define pb push_back
#define ll long long
#define d1(x)  cerr << #x << "--> " << x << endl
#define d2(x,y)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<endl
#define d3(x,y,z)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z<< endl
#define d4(x,y,z,w)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z << " | "<< #w << "--> " << w <<endl
#define vpll vector<pair<ll,ll>>
#define F first
#define S second
#define T ll tt; cin>>tt; while(tt--)
using namespace std;
ll mode=1e9+7;
const long long maxn=8001;
const long long inf=99999999999;
ll lcm(ll a, ll b){ return (a*b)/__gcd(a,b); }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll getRand(ll l, ll r){ uniform_int_distribution<ll> uid(l, r); return uid(rng); }

ll power(ll x, ll y){
	ll p=mode, res=1;
    x = x % p;
    while (y > 0) {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

void solve(){

	ll n;
	cin>>n;
	ll st=0, qu=0, dqF=0, dqB=0;
	for (int i=0;i<n;i++){
		ll a;
		cin>>a;
		if (a==0){

			vector<pair<ll,string>> vs;
			if (st!=0) vs.pb({st, "popStack"});
			if (qu!=0) vs.pb({qu, "popQueue"});
			if (dqF!=0) vs.pb({dqF, "popFront"});
			if (dqB!=0) vs.pb({dqB, "popBack"});
			sort(vs.begin(), vs.end());
			reverse(vs.begin(), vs.end());
			vector<string> ans;
			ll cnt=0;
			for (int j=0;j<vs.size() && j<3;j++){
				bool ok=true;
				if (ok) ans.pb(vs[j].S);
			}
			cout<<ans.size();
			for (int j=0;j<ans.size();j++){
				cout<<" "<<ans[j];
			}
			cout<<endl;
			st=0;
			qu=0;
			dqF=0;
			dqB=0;
		}
		else{
			if (st==0){
				cout<<"pushStack"<<endl;
				st=a;
			}
			else if (qu==0){
				cout<<"pushQueue"<<endl;
				qu=a;
			}
			else if (dqF==0){
				cout<<"pushFront"<<endl;
				dqF=a;
			}
			else if (dqB==0){
				cout<<"pushBack"<<endl;
				dqB=a;
			}
			else if (st<a){
				cout<<"pushStack"<<endl;
				st=a;
			}
			else if (qu<a){
				cout<<"pushQueue"<<endl;
				qu=a;
			}
			else if (dqF<a){
				cout<<"pushFront"<<endl;
				dqF=a;
			}
			else if (dqB<a){
				cout<<"pushBack"<<endl;
				dqB=a;
			}
			else if (st<qu && st<dqF && st<dqB){
				cout<<"pushStack"<<endl;
				st=a;
			}
			else if (qu<dqF && qu<dqB){
				cout<<"pushQueue"<<endl;
				qu=a;
			}
			else if (dqF<dqB){
				cout<<"pushFront"<<endl;
				dqF=a;
			}
			else{
				cout<<"pushBack"<<endl;
				dqB=a;
			}
		}
	}

	return;
}

int main(){

    #ifndef ONLINE_JUDGE
		//freopen("input.txt", "r", stdin);
    #endif
    srand(time(0));

    ios::sync_with_stdio(0);
    cin.tie(0);

	//T{ solve(); }
	solve();

	return 0;
}


#include<bits/stdc++.h>
#define endl "\n"
#define pb push_back
#define ll long long
#define d1(x)  cerr << #x << "--> " << x << endl
#define d2(x,y)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<endl
#define d3(x,y,z)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z<< endl
#define d4(x,y,z,w)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z << " | "<< #w << "--> " << w <<endl
#define vpll vector<pair<ll,ll>>
#define F first
#define S second
#define T ll tt; cin>>tt; while(tt--)
using namespace std;
ll mode=1e9+7;
const long long maxn=8001;
const long long inf=99999999999;
ll lcm(ll a, ll b){ return (a*b)/__gcd(a,b); }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll getRand(ll l, ll r){ uniform_int_distribution<ll> uid(l, r); return uid(rng); }

ll power(ll x, ll y){
	ll p=mode, res=1;
    x = x % p;
    while (y > 0) {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

void solve(){

	ll n;
	cin>>n;
	ll st=0, qu=0, dqF=0, dqB=0;
	for (int i=0;i<n;i++){
		ll a;
		cin>>a;
		if (a==0){

			vector<pair<ll,string>> vs;
			if (st!=0) vs.pb({st, "popStack"});
			if (qu!=0) vs.pb({qu, "popQueue"});
			if (dqF!=0) vs.pb({dqF, "popFront"});
			if (dqB!=0) vs.pb({dqB, "popBack"});
			sort(vs.begin(), vs.end());
			reverse(vs.begin(), vs.end());
			vector<string> ans;
			ll cnt=0;
			for (int j=0;j<vs.size() && j<3;j++){
				bool ok=true;
				if (ok) ans.pb(vs[j].S);
			}
			cout<<ans.size();
			for (int j=0;j<ans.size();j++){
				cout<<" "<<ans[j];
			}
			cout<<endl;
			st=0;
			qu=0;
			dqF=0;
			dqB=0;
		}
		else{
			if (st==0){
				cout<<"pushStack"<<endl;
				st=a;
			}
			else if (qu==0){
				cout<<"pushQueue"<<endl;
				qu=a;
			}
			else if (dqF==0){
				cout<<"pushFront"<<endl;
				dqF=a;
			}
			else if (dqB==0){
				cout<<"pushBack"<<endl;
				dqB=a;
			}
			else if (st<qu && st<dqF && st<dqB){
				cout<<"pushStack"<<endl;
				st=a;
			}
			else if (qu<dqF && qu<dqB){
				cout<<"pushQueue"<<endl;
				qu=a;
			}
			else if (dqF<dqB){
				cout<<"pushFront"<<endl;
				dqF=a;
			}
			else{
				cout<<"pushBack"<<endl;
				dqB=a;
			}
		}
	}

	return;
}

int main(){

    #ifndef ONLINE_JUDGE
		//freopen("input.txt", "r", stdin);
    #endif
    srand(time(0));

    ios::sync_with_stdio(0);
    cin.tie(0);

	//T{ solve(); }
	solve();

	return 0;
}