#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const double pi=3.1415926535897932384626;
inline ll read(){
	ll x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
int n;
vector<int> ans;
int main(){
    n=read();
    for(int i=10;n&&i<=10000;++i){
        if(i%6==0||i%10==0||i%15==0){
            ans.push_back(i);
            --n;
        }
    }
    for(int i=0;i<ans.size();++i) printf("%d%c",ans[i],i<ans.size()-1?' ':'\n');
	return 0;
}

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
using namespace std;

int main()
{
    int N;
    cin >> N;
    int mx = 0;
    int mn = 1000;
    for (int i = 0; i < N;++i) {
        int a;
        cin >> a;
        mx = max(a, mx);
    }

    for (int i = 0;i < N;++i) {
        int b;
        cin >> b;
        mn = min(mn, b);
    }


    int ans = mn - mx + 1;
    if (ans > 0) {
        cout << ans;
    }
    else {
        cout << 0;
    }

    return 0;
}
