#define MST(a, b) memset(a,b,sizeof(a))
#define ALL(v) (v).begin(),(v).end()
#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL,LL> pll;
#include <ext/pb_ds/priority_queue.hpp>
#define rep(i,a,b) for(int i = a ; i <= b ; ++i)
#define per(i,a,b) for(int i = a ; i >= b ; --i)
#define fors(i,S) for(int i = S ; i ; i = (i-1)&S)
#define forn(i,n) for(int i = 0 ; i < n ; ++i)

using namespace __gnu_pbds;
//typedef __gnu_pbds::priority_queue<pii, greater<pii>, pairing_heap_tag> heap;
//typedef heap::point_iterator iter;
typedef unsigned long long ULL;
//typedef __int128 LL128;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

int system_const;
namespace fast_IO{
    const int maxbuff = 1<<17;
    char ibuff[maxbuff],obuff[maxbuff];
    inline char Getchar(){
        static char *p1=ibuff,*p2=ibuff;
        if(p1 == p2) {
            p1 = ibuff;
            p2 = ibuff+fread(ibuff,1,maxbuff,stdin);
            if(p1 == p2) return -1;
        }
        return *p1++;
    }

    int optr = 0;
    inline void Putchar(char c) {
        if(optr == maxbuff) {fwrite(obuff,1,optr,stdout);optr = 0;}
        obuff[optr++] = c;
    }

    inline void Flush() {
        fwrite(obuff,1,optr,stdout);
    }

    template<class T>
    void read_number(T &x) {
        x = 0;
        char c;int f = 0;
        for(c = Getchar() ; c != '-' && (c < '0' || c > '9') ; c = Getchar());
        if(c == '-') f = 1;
        else x = c-'0';
        for(c = Getchar() ; c >= '0' && c <= '9' ; c = Getchar()) x = x*10+c-'0';
        if(f) x = -x;
    }

    void read_string(string &s) {
        s.clear();
        char c;
        for(c = Getchar() ; c == ' ' || c == '\n' ; c = Getchar());
        s.push_back(c);
        for(c = Getchar() ; c != ' ' && c != '\n' ; c = Getchar())
            s.push_back(c);
    }

    template<class T>
    void write_number(T &x) {
        static int dec[20];int len = 0;
        if(x == 0) {Putchar('0');return ;}
        if(x < 0) {Putchar('-');x = -x;}
        while(x) {
            dec[++len] = x%10;
            x /= 10;
        }
        while(len) Putchar(dec[len--]+'0');
    }

    void write_string(const string &s) {
        for(int i = 0 ;i < s.size() ; ++i)
            Putchar(s[i]);
    }
}
void read(string &s) {
    if(system_const == 0) {
        using namespace fast_IO;
        read_string(s);
    }
    else cin >> s;
}
template<class T> void read(T &x) {
    if(system_const == 0) {
        using namespace fast_IO;
        read_number(x);
    }
    else cin >> x;
}
void write(const string &s) {
    if(system_const == 0) {
        fast_IO::write_string(s);
    }
    else cout << s;
}
template<class T> void write(T &x) {
    if(system_const == 0) {
        fast_IO::write_number(x);
    }
    else cout << x;
}
void writeln(const string &s) {
    write(s);
    if(system_const == 0) {
        using namespace fast_IO;
        Putchar('\n');
    }
    else cout << endl;
}
template<class T> void writeln(T x) {
    write(x);
    if(system_const == 0) {
        using namespace fast_IO;
        Putchar('\n');
    }
    else cout << '\n';
}
void writesp(const string &s) {
    write(s);
    if(system_const == 0) {
        using namespace fast_IO;
        Putchar(' ');
    }
    else cout << ' ';
}

template<class T> void writesp(T x) {
    write(x);
    if(system_const == 0) {
        using namespace fast_IO;
        Putchar(' ');
    }
    else cout << ' ';
}
void set_program_type(int t = 0) {
    system_const = t;
    if(t) {
        ios::sync_with_stdio(0);
        cin.tie(0);cout.tie(0);
    }
}
void finish_program(int t = 0) {
    if(!t) fast_IO::Flush();
}

void init_all(int t = 0) {
#ifdef LOCAL
    if ((t >> 1) & 1) freopen("input", "r", stdin);
    if ((t >> 2) & 1) freopen("output", "w", stdout);
#endif
}

int pre_ask_time;
void show_time() {
    int now = clock();
    cout << now-pre_ask_time << endl;
    pre_ask_time = now;
}

template<class T> void cmin(T &x,const T&y) {if(x > y) x = y;}

const int NN = 4e5+19,N = 1000+19,M = 1<<15,D = 14;
LL inf = 1e17+7;
int nxt[N][D],fa[N];
int n,tot,jmp[N],m;
LL f[N][M],w[N],det[N];
char s[NN];
vector<int> bit[D+1];
int vis[M];
void solve() {
    bit[0].push_back(0);

    rep(i,1,D) {
        for(auto v : bit[i-1]) rep(j,0,D-1)
            if(~v>>j&1) if(!vis[v|(1<<j)]) {
                bit[i].push_back(v|(1<<j));
                vis[v|(1<<j)] = 1;
            }
    }

    scanf("%d",&m);
    rep(i,1,m) {
        int x;
        scanf("%s%d",s+1,&x);
        int cur = 0,len = strlen(s+1);
        rep(j,1,len) {
            if(!nxt[cur][s[j]-'a']) nxt[cur][s[j]-'a'] = ++tot;
            cur = nxt[cur][s[j]-'a'];
        }
        w[cur] += x;
    }

    {
        queue<int> q;
        q.push(0);
        while(!q.empty()) {
            int cur = q.front();q.pop();
            rep(i,0,D-1) if(nxt[cur][i]) {
                int p = nxt[cur][i];
                fa[p] = cur?nxt[fa[cur]][i]:0;
                q.push(p);
                w[p] += w[fa[p]];
            }
            else nxt[cur][i] = nxt[fa[cur]][i];
        }
    }

    scanf("%s",s+1);
    n = strlen(s+1);

    rep(i,0,tot) {
        jmp[i] = i;
        det[i] = 0;
        rep(j,0,M-1) f[i][j] = -inf;
    }
    f[0][0] = 0;

    int dep = 0;
    rep(i,1,n) if(s[i] == '?') {
        rep(j,0,tot) for(auto mask : bit[dep]) if(f[j][mask] != -inf) {
            rep(c,0,D-1) if(~mask>>c&1) {
                int q = nxt[jmp[j]][c];
                f[q][mask|(1<<c)] = max(f[q][mask|(1<<c)],f[j][mask]+w[q]+det[q]);
            }
        }
        rep(j,0,tot) {
            jmp[j] = j;
            det[j] = 0;
        }
        ++dep;
    }
    else {
        rep(j,0,tot) {
            jmp[j] = nxt[jmp[j]][s[i]-'a'];
            det[j] += w[jmp[j]];
        }
    }

    LL ans = -inf;
    rep(j,0,tot) for(auto v : bit[dep])
        ans = max(ans,f[j][v]+det[j]);
    writeln(ans);
}

signed main() {
    //srand((int)time(0));
    pre_ask_time = clock();
    init_all(3);
    //init();
    set_program_type(0);

    int T = 1;
    //read(T);
    //scanf("%d",&T);
    rep(i,1,T) {
        //printf("Case #%d: ",i);
        solve();
    }

    finish_program(0);

    return 0;
}


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

#define CO const
#define IN inline
typedef long long int64;

template<class T> IN T read(){
	T x=0,w=1;char c=getchar();
	for(;!isdigit(c);c=getchar())if(c=='-') w=-w;
	for(;isdigit(c);c=getchar()) x=x*10+c-'0';
	return x*w;
}
template<class T> IN T read(T&x){
	return x=read<T>();
}
template<class T> IN void chkmax(T&x,CO T&y){
	if(x<y) x=y;
}

CO int N=1e3+10,M=4e5+10;
CO int64 inf=1e18;
int ch[N][14],fa[N],val[N],tot;

void insert(char str[],int n,int v){
	int x=0;
	for(int i=1;i<=n;++i){
		int c=str[i]-'a';
		if(!ch[x][c]) ch[x][c]=++tot;
		x=ch[x][c];
	}
	val[x]+=v;
}
void build(){
	deque<int> Q;
	for(int c=0;c<14;++c)
		if(ch[0][c]) Q.push_back(ch[0][c]);
	while(Q.size()){
		int x=Q.front();Q.pop_front();
		val[x]+=val[fa[x]];
		for(int c=0;c<14;++c){
			if(!ch[x][c]) ch[x][c]=ch[fa[x]][c];
			else{
				fa[ch[x][c]]=ch[fa[x]][c];
				Q.push_back(ch[x][c]);
			}
		}
	}
}

char str[M];
int pos[30],to[30][N];int64 sum[30][N];
int64 dp[2][1<<14][N];

int main(){
	for(int K=read<int>();K--;){
		scanf("%s",str+1);
		insert(str,strlen(str+1),read<int>());
	}
	build();
	scanf("%s",str+1);
	int n=strlen(str+1),m=0;
	for(int l=1,r;l<=n;l=r+1){
		if(str[l]=='?') r=l;
		else for(r=l;r<n and str[r+1]!='?';++r);
		pos[++m]=l;
		if(str[l]=='?') continue;
		for(int x=0;x<=tot;++x){
			int y=x;
			for(int i=l;i<=r;++i){
				y=ch[y][str[i]-'a'];
				sum[m][x]+=val[y];
			}
			to[m][x]=y;
		}
	}
	for(int s=0;s<1<<14;++s)
		fill(dp[0][s],dp[0][s]+tot+1,-inf);
	dp[0][0][0]=0;
	for(int i=0;i<m;++i){
		for(int s=0;s<1<<14;++s)
			fill(dp[(i+1)&1][s],dp[(i+1)&1][s]+tot+1,-inf);
		for(int s=0;s<1<<14;++s)
			for(int x=0;x<=tot;++x)if(dp[i&1][s][x]>-inf){
				if(str[pos[i+1]]=='?'){
					for(int c=0;c<14;++c)if(~s>>c&1)
						chkmax(dp[(i+1)&1][s|1<<c][ch[x][c]],dp[i&1][s][x]+val[ch[x][c]]);
				}
				else chkmax(dp[(i+1)&1][s][to[i+1][x]],dp[i&1][s][x]+sum[i+1][x]);
			}
	}
	int64 ans=-inf;
	for(int s=0;s<1<<14;++s)for(int x=0;x<=tot;++x)
		chkmax(ans,dp[m&1][s][x]);
	printf("%lld\n",ans);
	return 0;
}


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

#define CO const
#define IN inline
typedef long long int64;

template<class T> IN T read(){
	T x=0,w=1;char c=getchar();
	for(;!isdigit(c);c=getchar())if(c=='-') w=-w;
	for(;isdigit(c);c=getchar()) x=x*10+c-'0';
	return x*w;
}
template<class T> IN T read(T&x){
	return x=read<T>();
}
template<class T> IN void chkmax(T&x,CO T&y){
	if(x<y) x=y;
}

CO int N=1e3+10,M=4e5+10;
CO int64 inf=1e18;
int ch[N][14],fa[N],val[N],tot;

void insert(char str[],int n,int v){
	int x=0;
	for(int i=1;i<=n;++i){
		int c=str[i]-'a';
		if(!ch[x][c]) ch[x][c]=++tot;
		x=ch[x][c];
	}
	val[x]+=v;
}
void build(){
	deque<int> Q;
	for(int c=0;c<14;++c)
		if(ch[0][c]) Q.push_back(ch[0][c]);
	while(Q.size()){
		int x=Q.front();Q.pop_front();
		val[x]+=val[fa[x]];
		for(int c=0;c<14;++c){
			if(!ch[x][c]) ch[x][c]=ch[fa[x]][c];
			else{
				fa[ch[x][c]]=ch[fa[x]][c];
				Q.push_back(ch[x][c]);
			}
		}
	}
}

char str[M];
int pos[30],to[30][N],sum[30][N];
int64 dp[2][1<<14][N];

int main(){
	for(int K=read<int>();K--;){
		scanf("%s",str+1);
		insert(str,strlen(str+1),read<int>());
	}
	build();
	scanf("%s",str+1);
	int n=strlen(str+1),m=0;
	for(int l=1,r;l<=n;l=r+1){
		if(str[l]=='?') r=l;
		else for(r=l;r<n and str[r+1]!='?';++r);
		pos[++m]=l;
		if(str[l]=='?') continue;
		for(int x=0;x<=tot;++x){
			int y=x;
			for(int i=l;i<=r;++i){
				y=ch[y][str[i]-'a'];
				sum[m][x]+=val[y];
			}
			to[m][x]=y;
		}
	}
	for(int s=0;s<1<<14;++s)
		fill(dp[0][s],dp[0][s]+tot+1,-inf);
	dp[0][0][0]=0;
	for(int i=0;i<m;++i){
		for(int s=0;s<1<<14;++s)
			fill(dp[(i+1)&1][s],dp[(i+1)&1][s]+tot+1,-inf);
		for(int s=0;s<1<<14;++s)
			for(int x=0;x<=tot;++x)if(dp[i&1][s][x]>-inf){
				if(str[pos[i+1]]=='?'){
					for(int c=0;c<14;++c)if(~s>>c&1)
						chkmax(dp[(i+1)&1][s|1<<c][ch[x][c]],dp[i&1][s][x]+val[ch[x][c]]);
				}
				else chkmax(dp[(i+1)&1][s][to[i+1][x]],dp[i&1][s][x]+sum[i+1][x]);
			}
	}
	int64 ans=-inf;
	for(int s=0;s<1<<14;++s)for(int x=0;x<=tot;++x)
		chkmax(ans,dp[m&1][s][x]);
	printf("%lld\n",ans);
	return 0;
}


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

#define CO const
#define IN inline
typedef long long int64;

template<class T> IN T read(){
	T x=0,w=1;char c=getchar();
	for(;!isdigit(c);c=getchar())if(c=='-') w=-w;
	for(;isdigit(c);c=getchar()) x=x*10+c-'0';
	return x*w;
}
template<class T> IN T read(T&x){
	return x=read<T>();
}
template<class T> IN void chkmax(T&x,CO T&y){
	if(x<y) x=y;
}

CO int N=1e3+10,M=4e5+10;
CO int64 inf=1e18;
int ch[N][14],fa[N],val[N],tot;

void insert(char str[],int n,int v){
	int x=0;
	for(int i=1;i<=n;++i){
		int c=str[i]-'a';
		if(!ch[x][c]) ch[x][c]=++tot;
		x=ch[x][c];
	}
	val[x]+=v;
}
void build(){
	deque<int> Q;
	for(int c=0;c<14;++c)
		if(ch[0][c]) Q.push_back(ch[0][c]);
	while(Q.size()){
		int x=Q.front();Q.pop_front();
		val[x]+=val[fa[x]];
		for(int c=0;c<14;++c){
			if(!ch[x][c]) ch[x][c]=ch[fa[x]][c];
			else{
				fa[ch[x][c]]=ch[fa[x]][c];
				Q.push_back(ch[x][c]);
			}
		}
	}
}

char str[M];
int pos[30],to[30][N],sum[30][N];
int64 dp[2][1<<14][N];

int main(){
	for(int K=read<int>();K--;){
		scanf("%s",str+1);
		insert(str,strlen(str+1),read<int>());
	}
	build();
	scanf("%s",str+1);
	int n=strlen(str+1),m=0;
	for(int l=1,r;l<=n;l=r+1){
		if(str[l]=='?') r=l;
		else for(r=l;r<n and str[r+1]==str[l];++r);
		pos[++m]=l;
		if(str[l]=='?') continue;
		for(int x=0;x<=tot;++x){
			int y=x;
			for(int i=l;i<=r;++i){
				y=ch[y][str[i]-'a'];
				sum[m][x]+=val[y];
			}
			to[m][x]=y;
		}
	}
	for(int s=0;s<1<<14;++s)
		fill(dp[0][s],dp[0][s]+tot+1,-inf);
	dp[0][0][0]=0;
	for(int i=0;i<m;++i){
		for(int s=0;s<1<<14;++s)
			fill(dp[(i+1)&1][s],dp[(i+1)&1][s]+tot+1,-inf);
		for(int s=0;s<1<<14;++s)
			for(int x=0;x<=tot;++x)if(dp[i&1][s][x]>-inf){
				if(str[pos[i+1]]=='?'){
					for(int c=0;c<14;++c)if(~s>>c&1)
						chkmax(dp[(i+1)&1][s|1<<c][ch[x][c]],dp[i&1][s][x]+val[ch[x][c]]);
				}
				else chkmax(dp[(i+1)&1][s][to[i+1][x]],dp[i&1][s][x]+sum[i+1][x]);
			}
	}
	int64 ans=-inf;
	for(int s=0;s<1<<14;++s)for(int x=0;x<=tot;++x)
		chkmax(ans,dp[m&1][s][x]);
	printf("%lld\n",ans);
	return 0;
}


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

#define CO const
#define IN inline
typedef long long int64;

template<class T> IN T read(){
	T x=0,w=1;char c=getchar();
	for(;!isdigit(c);c=getchar())if(c=='-') w=-w;
	for(;isdigit(c);c=getchar()) x=x*10+c-'0';
	return x*w;
}
template<class T> IN T read(T&x){
	return x=read<T>();
}
template<class T> IN void chkmax(T&x,CO T&y){
	if(x<y) x=y;
}

CO int N=1e3+10,M=4e5+10;
CO int64 inf=1e18;
int ch[N][14],fa[N],val[N],tot;

void insert(char str[],int n,int v){
	int x=0;
	for(int i=1;i<=n;++i){
		int c=str[i]-'a';
		if(!ch[x][c]) ch[x][c]=++tot;
		x=ch[x][c];
	}
	val[x]+=v;
}
void build(){
	deque<int> Q;
	for(int c=0;c<14;++c)
		if(ch[0][c]) Q.push_back(ch[0][c]);
	while(Q.size()){
		int x=Q.front();Q.pop_front();
		val[x]+=val[fa[x]];
		for(int c=0;c<14;++c){
			if(!ch[x][c]) ch[x][c]=ch[fa[x]][c];
			else{
				fa[ch[x][c]]=ch[fa[x]][c];
				Q.push_back(ch[x][c]);
			}
		}
	}
}

char str[M];
int pos[30],to[30][N],sum[30][N];
int64 dp[2][1<<14][N];

int main(){
	for(int K=read<int>();K--;){
		scanf("%s",str+1);
		insert(str,strlen(str+1),read<int>());
	}
	build();
	scanf("%s",str+1);
	int n=strlen(str+1),m=0;
	for(int l=1,r;l<=n;l=r+1){
		if(str[l]=='?') r=l;
		else for(r=l;r<n and str[r+1]!='?';++r);
		pos[++m]=l;
		if(str[l]=='?') continue;
		for(int x=0;x<=tot;++x){
			int y=x;
			for(int i=l;i<=r;++i){
				y=ch[y][str[i]-'a'];
				sum[m][x]+=val[y];
			}
			to[m][x]=y;
		}
	}
	assert(m<30);
	for(int s=0;s<1<<14;++s)
		fill(dp[0][s],dp[0][s]+tot+1,-inf);
	dp[0][0][0]=0;
	for(int i=0;i<m;++i){
		for(int s=0;s<1<<14;++s)
			fill(dp[(i+1)&1][s],dp[(i+1)&1][s]+tot+1,-inf);
		for(int s=0;s<1<<14;++s)
			for(int x=0;x<=tot;++x)if(dp[i&1][s][x]>-inf){
				if(str[pos[i+1]]=='?'){
					for(int c=0;c<14;++c)if(~s>>c&1)
						chkmax(dp[(i+1)&1][s|1<<c][ch[x][c]],dp[i&1][s][x]+val[ch[x][c]]);
				}
				else chkmax(dp[(i+1)&1][s][to[i+1][x]],dp[i&1][s][x]+sum[i+1][x]);
			}
	}
	int64 ans=-inf;
	for(int s=0;s<1<<14;++s)for(int x=0;x<=tot;++x)
		chkmax(ans,dp[m&1][s][x]);
	printf("%lld\n",ans);
	return 0;
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
#define itn int
#define all(c) c.begin(),c.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ll long long
#define ull unsigned long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define mp(x, y) make_pair(x, y)
using namespace std;

const ll inf = 1e18, mod = 1000000007;
const double PI = 3.1415926536;
int days[13] = {0, 31, 28, 31, 30, 31,30, 31, 31, 30, 31, 30, 31};

template<typename T>
ostream& operator <<(ostream& out, const vector<T>& mas) {
    for (const auto& x : mas) {
        out << x << ' ';
    }
    return out;
}

template <typename Iterator>
class IteratorRange {
public:
    IteratorRange (Iterator f, Iterator l)
        : first(f), last(l) {}

    Iterator begin () const {
        return first;
    }
    Iterator end () const {
        return last;
    }

private:
    Iterator first , last;
};

void ok() {
    cout << "YES" << '\n';
}

void no() {
    cout << "NO" << '\n';
}

inline ll nxt() {
    ll x;
    cin >> x;
    return x;
}

template<size_t sigma>
class Aho_Corasick {
public:
    Aho_Corasick() {
        cnt.assign(MAXN, 0);
        sufLink.assign(MAXN, 0);
        go.assign(MAXN, vector<int>(sigma, 0));
        sz = 1;
    }

    void add_str(const string& s, ll d) {
        int cur = 0;
        for(auto c : s) {
            c -= 'a';
            if(!go[cur][c]) {
                go[cur][c] = sz++;
            }
            cur = go[cur][c];
        }
        cnt[cur] += d;
    }

    void build() {
        queue<int> q;
        q.push(0);
        while (!q.empty()) {
            int v = q.front();
            int u = sufLink[v];
            if (u) cnt[v] += cnt[u];
            q.pop();
            for (int i = 0; i < sigma; i++) {
                int to = go[v][i];
                int suf = v ? go[u][i] : 0;
                if (go[v][i]) {
                    sufLink[to] = suf;
                    q.push(to);
                } else {
                    go[v][i] = go[u][i];
                }
            }
        }
    }

    inline pll match(const string &a, int v = 0) {
        ll res = 0;
        for (char c : a) {
            c -= 'a';
            v = go[v][c];
            res += cnt[v];
        }
        return {v, res};
    }
    int sz;

    static const int MAXN = 1024;
    vector<ll> cnt, sufLink;
    vector<vector<int>> go;
};

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int n = nxt();
    Aho_Corasick<14> aho;
    for (int i = 0; i < n; i++) {
        string s;
        int cost;
        cin >> s >> cost;
        aho.add_str(s, cost);
    }
    aho.build();
    string s;
    cin >> s;
    vector<int> pos;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '?') {
            pos.push_back(i);
        }
    }
    if (pos.size() == 0) {
        cout << aho.match(s).second;
        exit(0);
    }

    vector<vector<ll>> dp(1 << 14, vector<ll>(aho.sz, -inf));
    for (int c = 0; c < 14; c++) {
        s[pos[0]] = char(c + 'a');
        pll ans = aho.match(s.substr(0, pos[0] + 1));
        dp[(1 << c)][ans.first] = ans.second;
    }

    int prev = pos[0];
    for (auto indx : IteratorRange<vector<int>::iterator>(pos.begin() + 1, pos.end())) {
        vector<vector<ll>> new_dp(1 << 14, vector<ll>(aho.sz, -inf));
        vector<pll> clc(aho.sz);
        string st = s.substr(prev + 1, indx - prev - 1);
        for (int i = 0; i < aho.sz; i++) {
            clc[i] = aho.match(st, i);
        }
        for (char c = 'a'; c < 'a' + 14; c++) {
            int cur = c - 'a';
            s[indx] = c;
            vector<pll> calc(aho.sz);
            for (int i = 0; i < aho.sz; i++) {
                int to = aho.go[clc[i].first][cur];
                calc[i] = {to, aho.cnt[to] + clc[i].second};
            }
            for (int mask = 0; mask < (1 << 14); mask++) {
                if ((mask >> cur) & 1) continue;
                for (int i = 0; i < aho.sz; i++) {
                    new_dp[mask | (1 << cur)][calc[i].first] = max(
                        new_dp[mask | (1 << cur)][calc[i].first],
                        dp[mask][i] + calc[i].second
                    );
                }
            }
        }
        prev = indx;
        dp = move(new_dp);
    }

    if (pos.back() != s.size() - 1) {
        vector<vector<ll>> new_dp(1 << 14, vector<ll>(aho.sz, -inf));
        vector<pll> calc(aho.sz);
        string st = s.substr(pos.back() + 1);
        for (int j = 0; j < aho.sz; j++) {
            calc[j] = aho.match(st, j);
        }
        for (int mask = 0; mask < (1 << 14); mask++) {
            for (int j = 0; j < aho.sz; j++) {
                pll& ans = calc[j];
                new_dp[mask][ans.first] = max(
                    new_dp[mask][ans.first],
                    dp[mask][j] + ans.second
                );
            }
        }
        dp = move(new_dp);
    }

    ll ans = -inf;
    for (int mask = 0; mask < (1 << 14); mask++) {
        if (__builtin_popcount(mask) != pos.size())
            continue;
        for (auto x : dp[mask]) {
            ans = max(ans, x);
        }
    }
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
#define itn int
#define all(c) c.begin(),c.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ll long long
#define ull unsigned long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define mp(x, y) make_pair(x, y)
using namespace std;

const ll inf = 1e18, mod = 1000000007;
const double PI = 3.1415926536;
int days[13] = {0, 31, 28, 31, 30, 31,30, 31, 31, 30, 31, 30, 31};

template<typename T>
ostream& operator <<(ostream& out, const vector<T>& mas) {
    for (const auto& x : mas) {
        out << x << ' ';
    }
    return out;
}

template <typename Iterator>
class IteratorRange {
public:
    IteratorRange (Iterator f, Iterator l)
        : first(f), last(l) {}

    Iterator begin () const {
        return first;
    }
    Iterator end () const {
        return last;
    }

private:
    Iterator first , last;
};

void ok() {
    cout << "YES" << '\n';
}

void no() {
    cout << "NO" << '\n';
}

inline ll nxt() {
    ll x;
    cin >> x;
    return x;
}

template<size_t sigma>
class Aho_Corasick {
public:
    Aho_Corasick() {
        cnt.resize(MAXN);
        sufLink.resize(MAXN);
        go.assign(MAXN, vector<int>(sigma));
        sz = 1;
    }

    void add_str(const string& s, ll d) {
        int cur = 0;
        for(auto c : s) {
            c -= 'a';
            if(!go[cur][c]) {
                go[cur][c] = sz++;
            }
            cur = go[cur][c];
        }
        cnt[cur] += d;
    }

    void build() {
        queue<int> q;
        q.push(0);
        while (!q.empty()) {
            int v = q.front();
            int u = sufLink[v];
            cnt[v] += cnt[u];
            q.pop();
            for (int i = 0; i < sigma; i++) {
                int to = go[v][i];
                int suf = v ? go[u][i] : 0;
                if (go[v][i]) {
                    sufLink[to] = suf;
                    q.push(to);
                } else {
                    go[v][i] = suf;
                }
            }
        }
    }

    pll match(const string& text, int cur = 0) {
        int len = text.size();
        ll ans = 0;
        for (int i = 0; i < len; i++) {
            int c = text[i] - 'a';
            cur = go[cur][c];
            ans += cnt[cur];
        }
        return {cur, ans};
    }
    int sz;
private:
    static const int MAXN = 1024;
    vector<ll> cnt, sufLink;
    vector<vector<int>> go;
};

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int n = nxt();
    Aho_Corasick<14> aho;
    for (int i = 0; i < n; i++) {
        string s;
        int cost;
        cin >> s >> cost;
        aho.add_str(s, cost);
    }
    aho.build();
    string s;
    cin >> s;
    vector<int> pos;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '?') {
            pos.push_back(i);
        }
    }
    if (pos.size() == 0) {
        cout << aho.match(s).second;
        exit(0);
    }

    vector<vector<ll>> dp(1 << 14, vector<ll>(aho.sz, -inf));
    for (int c = 0; c < 14; c++) {
        s[pos[0]] = char(c + 'a');
        pii ans = aho.match(s.substr(0, pos[0] + 1));
        dp[1 << c][ans.first] = ans.second;
    }

    int prev = pos[0];
    for (auto indx : IteratorRange(pos.begin() + 1, pos.end())) {
        vector<vector<ll>> new_dp(1 << 14, vector<ll>(aho.sz, -inf));
        for (char c = 'a'; c < 'a' + 14; c++) {
            int cur = c - 'a';
            s[indx] = c;
            string st = s.substr(prev + 1, indx - prev);
            vector<pll> calc(aho.sz);
            for (int i = 0; i < aho.sz; i++) {
                 calc[i] = aho.match(st, i);
            }
            for (int mask = 0; mask < (1 << 14); mask++) {
                if ((mask >> cur) & 1) continue;
                for (int i = 0; i < aho.sz; i++) {
                    new_dp[mask | (1 << cur)][calc[i].first] = max(
                        new_dp[mask | (1 << cur)][calc[i].first],
                        dp[mask][i] + calc[i].second
                    );
                }
            }
        }
        prev = indx;
        dp = move(new_dp);
    }

    if (pos.back() != s.size() - 1) {
        vector<vector<ll>> new_dp(1 << 14, vector<ll>(aho.sz, -inf));
        vector<pll> calc(aho.sz);
        string st = s.substr(pos.back() + 1);
        for (int j = 0; j < aho.sz; j++) {
            calc[j] = aho.match(st, j);
        }
        for (int mask = 0; mask < (1 << 14); mask++) {
            for (int j = 0; j < aho.sz; j++) {
                pll& ans = calc[j];
                new_dp[mask][ans.first] = max(
                    new_dp[mask][ans.first],
                    dp[mask][j] + ans.second
                );
            }
        }
        dp = move(new_dp);
    }

    ll ans = -inf;
    for (int mask = 0; mask < (1 << 14); mask++) {
        if (__builtin_popcount(mask) != pos.size())
            continue;
        for (auto x : dp[mask]) {
            ans = max(ans, x);
        }
    }
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
#define itn int
#define all(c) c.begin(),c.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ll long long
#define ull unsigned long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define mp(x, y) make_pair(x, y)
using namespace std;

const ll inf = 1e18, mod = 1000000007;
const double PI = 3.1415926536;
int days[13] = {0, 31, 28, 31, 30, 31,30, 31, 31, 30, 31, 30, 31};

template<typename T>
ostream& operator <<(ostream& out, const vector<T>& mas) {
    for (const auto& x : mas) {
        out << x << ' ';
    }
    return out;
}

template <typename Iterator>
class IteratorRange {
public:
    IteratorRange (Iterator f, Iterator l)
        : first(f), last(l) {}

    Iterator begin () const {
        return first;
    }
    Iterator end () const {
        return last;
    }

private:
    Iterator first , last;
};

void ok() {
    cout << "YES" << '\n';
}

void no() {
    cout << "NO" << '\n';
}

inline ll nxt() {
    ll x;
    cin >> x;
    return x;
}

template<size_t sigma>
class Aho_Corasick {
public:
    Aho_Corasick() {
        cnt.assign(MAXN, 0);
        sufLink.assign(MAXN, 0);
        go.assign(MAXN, vector<int>(sigma, 0));
        sz = 1;
    }

    void add_str(const string& s, ll d) {
        int cur = 0;
        for(auto c : s) {
            c -= 'a';
            if(!go[cur][c]) {
                go[cur][c] = sz++;
            }
            cur = go[cur][c];
        }
        cnt[cur] += d;
    }

    void build() {
        queue<int> q;
        q.push(0);
        while (!q.empty()) {
            int v = q.front();
            int u = sufLink[v];
            if (u) cnt[v] += cnt[u];
            q.pop();
            for (int i = 0; i < sigma; i++) {
                int to = go[v][i];
                int suf = v ? go[u][i] : 0;
                if (go[v][i]) {
                    sufLink[to] = suf;
                    q.push(to);
                } else {
                    go[v][i] = go[u][i];
                }
            }
        }
    }

    inline pll match(const string &a, int v = 0) {
        ll res = 0;
        for (char c : a) {
            c -= 'a';
            v = go[v][c];
            res += cnt[v];
        }
        return {v, res};
    }
    int sz;

    static const int MAXN = 1024;
    vector<ll> cnt, sufLink;
    vector<vector<int>> go;
};

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int n = nxt();
    Aho_Corasick<14> aho;
    for (int i = 0; i < n; i++) {
        string s;
        int cost;
        cin >> s >> cost;
        aho.add_str(s, cost);
    }
    aho.build();
    string s;
    cin >> s;
    vector<int> pos;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '?') {
            pos.push_back(i);
        }
    }
    if (pos.size() == 0) {
        cout << aho.match(s).second;
        exit(0);
    }

    vector<vector<ll>> dp(1 << 14, vector<ll>(aho.sz, -inf));
    for (int c = 0; c < 14; c++) {
        s[pos[0]] = char(c + 'a');
        pll ans = aho.match(s.substr(0, pos[0] + 1));
        dp[(1 << c)][ans.first] = ans.second;
    }

    int prev = pos[0];
    int cnt = 1;
    for (auto indx : IteratorRange<vector<int>::iterator>(pos.begin() + 1, pos.end())) {
        vector<vector<ll>> new_dp(1 << 14, vector<ll>(aho.sz, -inf));
        vector<pll> clc(aho.sz);
        string st = s.substr(prev + 1, indx - prev - 1);
        for (int i = 0; i < aho.sz; i++) {
            clc[i] = aho.match(st, i);
        }
        for (char c = 'a'; c < 'a' + 14; c++) {
            int cur = c - 'a';
            s[indx] = c;
            vector<pll> calc(aho.sz);
            for (int i = 0; i < aho.sz; i++) {
                int to = aho.go[clc[i].first][cur];
                calc[i] = {to, aho.cnt[to] + clc[i].second};
            }
            for (int mask = 0; mask < (1 << 14); mask++) {
                if ((mask >> cur) & 1 || __builtin_popcount(mask) != cnt) continue;
                for (int i = 0; i < aho.sz; i++) {
                    new_dp[mask | (1 << cur)][calc[i].first] = max(
                        new_dp[mask | (1 << cur)][calc[i].first],
                        dp[mask][i] + calc[i].second
                    );
                }
            }
        }
        prev = indx;
        dp = move(new_dp);
        cnt++;
    }

    if (pos.back() != s.size() - 1) {
        vector<vector<ll>> new_dp(1 << 14, vector<ll>(aho.sz, -inf));
        vector<pll> calc(aho.sz);
        string st = s.substr(pos.back() + 1);
        for (int j = 0; j < aho.sz; j++) {
            calc[j] = aho.match(st, j);
        }
        for (int mask = 0; mask < (1 << 14); mask++) {
            for (int j = 0; j < aho.sz; j++) {
                pll& ans = calc[j];
                new_dp[mask][ans.first] = max(
                    new_dp[mask][ans.first],
                    dp[mask][j] + ans.second
                );
            }
        }
        dp = move(new_dp);
    }

    ll ans = -inf;
    for (int mask = 0; mask < (1 << 14); mask++) {
        if (__builtin_popcount(mask) != pos.size())
            continue;
        for (auto x : dp[mask]) {
            ans = max(ans, x);
        }
    }
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
#define itn int
#define all(c) c.begin(),c.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ll long long
#define ull unsigned long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define mp(x, y) make_pair(x, y)
using namespace std;

const ll inf = 1e18, mod = 1000000007;
const double PI = 3.1415926536;
int days[13] = {0, 31, 28, 31, 30, 31,30, 31, 31, 30, 31, 30, 31};

template<typename T>
ostream& operator <<(ostream& out, const vector<T>& mas) {
    for (const auto& x : mas) {
        out << x << ' ';
    }
    return out;
}

template <typename Iterator>
class IteratorRange {
public:
    IteratorRange (Iterator f, Iterator l)
        : first(f), last(l) {}

    Iterator begin () const {
        return first;
    }
    Iterator end () const {
        return last;
    }

private:
    Iterator first , last;
};

void ok() {
    cout << "YES" << '\n';
}

void no() {
    cout << "NO" << '\n';
}

inline ll nxt() {
    ll x;
    cin >> x;
    return x;
}

template<size_t sigma>
class Aho_Corasick {
public:
    Aho_Corasick() {
        cnt.assign(MAXN, 0);
        sufLink.assign(MAXN, 0);
        go.assign(MAXN, vector<int>(sigma, 0));
        sz = 1;
    }

    void add_str(const string& s, ll d) {
        int cur = 0;
        for(auto c : s) {
            c -= 'a';
            if(!go[cur][c]) {
                go[cur][c] = sz++;
            }
            cur = go[cur][c];
        }
        cnt[cur] += d;
    }

    void build() {
        queue<int> q;
        q.push(0);
        while (!q.empty()) {
            int v = q.front();
            int u = sufLink[v];
            if (u) cnt[v] += cnt[u];
            q.pop();
            for (int i = 0; i < sigma; i++) {
                int to = go[v][i];
                int suf = v ? go[u][i] : 0;
                if (go[v][i]) {
                    sufLink[to] = suf;
                    q.push(to);
                } else {
                    go[v][i] = go[u][i];
                }
            }
        }
    }

    inline pll match(const string &a, int v = 0) {
        ll res = 0;
        for (char c : a) {
            v = go[v][c];
            res += leaf[v];
        }
        return {v, res};
    }
    int sz;

private:
    static const int MAXN = 1024;
    vector<ll> cnt, sufLink;
    vector<vector<int>> go;
};

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int n = nxt();
    Aho_Corasick<14> aho;
    for (int i = 0; i < n; i++) {
        string s;
        int cost;
        cin >> s >> cost;
        aho.add_str(s, cost);
    }
    aho.build();
    string s;
    cin >> s;
    vector<int> pos;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '?') {
            pos.push_back(i);
        }
    }
    if (pos.size() == 0) {
        cout << aho.match(s).second;
        exit(0);
    }

    vector<vector<ll>> dp(1 << 14, vector<ll>(aho.sz, -inf));
    for (int c = 0; c < 14; c++) {
        s[pos[0]] = char(c + 'a');
        pll ans = aho.match(s.substr(0, pos[0] + 1));
        dp[(1 << c)][ans.first] = ans.second;
    }

    int prev = pos[0];
    for (auto indx : IteratorRange(pos.begin() + 1, pos.end())) {
        vector<vector<ll>> new_dp(1 << 14, vector<ll>(aho.sz, -inf));
        for (char c = 'a'; c < 'a' + 14; c++) {
            int cur = c - 'a';
            s[indx] = c;
            string st = s.substr(prev + 1, indx - prev);
            vector<pll> calc(aho.sz);
            for (int i = 0; i < aho.sz; i++) {
                 calc[i] = aho.match(st, i);
            }
            for (int mask = 0; mask < (1 << 14); mask++) {
                if ((mask >> cur) & 1) continue;
                for (int i = 0; i < aho.sz; i++) {
                    new_dp[mask | (1 << cur)][calc[i].first] = max(
                        new_dp[mask | (1 << cur)][calc[i].first],
                        dp[mask][i] + calc[i].second
                    );
                }
            }
        }
        prev = indx;
        dp = move(new_dp);
    }

    if (pos.back() != s.size() - 1) {
        vector<vector<ll>> new_dp(1 << 14, vector<ll>(aho.sz, -inf));
        vector<pll> calc(aho.sz);
        string st = s.substr(pos.back() + 1);
        for (int j = 0; j < aho.sz; j++) {
            calc[j] = aho.match(st, j);
        }
        for (int mask = 0; mask < (1 << 14); mask++) {
            for (int j = 0; j < aho.sz; j++) {
                pll& ans = calc[j];
                new_dp[mask][ans.first] = max(
                    new_dp[mask][ans.first],
                    dp[mask][j] + ans.second
                );
            }
        }
        dp = move(new_dp);
    }

    ll ans = -inf;
    for (int mask = 0; mask < (1 << 14); mask++) {
        if (__builtin_popcount(mask) != pos.size())
            continue;
        for (auto x : dp[mask]) {
            ans = max(ans, x);
        }
    }
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
#define itn int
#define all(c) c.begin(),c.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ll long long
#define ull unsigned long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define mp(x, y) make_pair(x, y)
using namespace std;

const ll inf = 1e18, mod = 1000000007;
const double PI = 3.1415926536;
int days[13] = {0, 31, 28, 31, 30, 31,30, 31, 31, 30, 31, 30, 31};

template<typename T>
ostream& operator <<(ostream& out, const vector<T>& mas) {
    for (const auto& x : mas) {
        out << x << ' ';
    }
    return out;
}

template <typename Iterator>
class IteratorRange {
public:
    IteratorRange (Iterator f, Iterator l)
        : first(f), last(l) {}

    Iterator begin () const {
        return first;
    }
    Iterator end () const {
        return last;
    }

private:
    Iterator first , last;
};

void ok() {
    cout << "YES" << '\n';
}

void no() {
    cout << "NO" << '\n';
}

inline ll nxt() {
    ll x;
    cin >> x;
    return x;
}

template<size_t sigma>
class Aho_Corasick {
public:
    Aho_Corasick() {
        cnt.assign(MAXN, 0);
        sufLink.assign(MAXN, 0);
        go.assign(MAXN, vector<int>(sigma, 0));
        sz = 1;
    }

    void add_str(const string& s, ll d) {
        int cur = 0;
        for(auto c : s) {
            c -= 'a';
            if(!go[cur][c]) {
                go[cur][c] = sz++;
            }
            cur = go[cur][c];
        }
        cnt[cur] += d;
    }

    void build() {
        queue<int> q;
        q.push(0);
        while (!q.empty()) {
            int v = q.front();
            int u = sufLink[v];
            if (u) cnt[v] += cnt[u];
            q.pop();
            for (int i = 0; i < sigma; i++) {
                int to = go[v][i];
                int suf = v ? go[u][i] : 0;
                if (go[v][i]) {
                    sufLink[to] = suf;
                    q.push(to);
                } else {
                    go[v][i] = go[u][i];
                }
            }
        }
    }

    inline pll match(const string &a, int v = 0) {
        ll res = 0;
        for (char c : a) {
            v = go[v][c];
            res += cnt[v];
        }
        return {v, res};
    }
    int sz;

private:
    static const int MAXN = 1024;
    vector<ll> cnt, sufLink;
    vector<vector<int>> go;
};

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int n = nxt();
    Aho_Corasick<14> aho;
    for (int i = 0; i < n; i++) {
        string s;
        int cost;
        cin >> s >> cost;
        aho.add_str(s, cost);
    }
    aho.build();
    string s;
    cin >> s;
    vector<int> pos;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '?') {
            pos.push_back(i);
        }
    }
    if (pos.size() == 0) {
        cout << aho.match(s).second;
        exit(0);
    }

    vector<vector<ll>> dp(1 << 14, vector<ll>(aho.sz, -inf));
    for (int c = 0; c < 14; c++) {
        s[pos[0]] = char(c + 'a');
        pll ans = aho.match(s.substr(0, pos[0] + 1));
        dp[(1 << c)][ans.first] = ans.second;
    }

    int prev = pos[0];
    for (auto indx : IteratorRange(pos.begin() + 1, pos.end())) {
        vector<vector<ll>> new_dp(1 << 14, vector<ll>(aho.sz, -inf));
        for (char c = 'a'; c < 'a' + 14; c++) {
            int cur = c - 'a';
            s[indx] = c;
            string st = s.substr(prev + 1, indx - prev);
            vector<pll> calc(aho.sz);
            for (int i = 0; i < aho.sz; i++) {
                 calc[i] = aho.match(st, i);
            }
            for (int mask = 0; mask < (1 << 14); mask++) {
                if ((mask >> cur) & 1) continue;
                for (int i = 0; i < aho.sz; i++) {
                    new_dp[mask | (1 << cur)][calc[i].first] = max(
                        new_dp[mask | (1 << cur)][calc[i].first],
                        dp[mask][i] + calc[i].second
                    );
                }
            }
        }
        prev = indx;
        dp = move(new_dp);
    }

    if (pos.back() != s.size() - 1) {
        vector<vector<ll>> new_dp(1 << 14, vector<ll>(aho.sz, -inf));
        vector<pll> calc(aho.sz);
        string st = s.substr(pos.back() + 1);
        for (int j = 0; j < aho.sz; j++) {
            calc[j] = aho.match(st, j);
        }
        for (int mask = 0; mask < (1 << 14); mask++) {
            for (int j = 0; j < aho.sz; j++) {
                pll& ans = calc[j];
                new_dp[mask][ans.first] = max(
                    new_dp[mask][ans.first],
                    dp[mask][j] + ans.second
                );
            }
        }
        dp = move(new_dp);
    }

    ll ans = -inf;
    for (int mask = 0; mask < (1 << 14); mask++) {
        if (__builtin_popcount(mask) != pos.size())
            continue;
        for (auto x : dp[mask]) {
            ans = max(ans, x);
        }
    }
    cout << ans;
    return 0;
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = null;

	private void solution() throws IOException {
		int n = nextInt();
		int l=nextInt();
		int k=nextInt();
		int a=50000;
		int b=2;
		int[] mas = new int[n];
		Arrays.fill(mas, 1);
		int i=1;
		if(a+1==n){
			System.out.println(-1);
			System.exit(0);
		}
		int cur=2;
		int br=3;
		while(k-->0){
			mas[i]=cur;
			cur*=2;
			i++;
		}
		while(l-->0){
			mas[i]=br;
			i++;
		}
	print(mas);
	}

	String nextToken() throws IOException {
		if (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(bf.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void print(int a[]) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
	}

	public static void main(String args[]) throws IOException {
		new C().solution();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = null;

	private void solution() throws IOException {
		int n = nextInt();
		int l=nextInt();
		int k=nextInt();
		int a=30000;
		int b=2;
		int[] mas = new int[n];
		Arrays.fill(mas, 1);
		mas[0]=2;
		if(k>0){
			mas[1]=3;
			k--;
			b++;
		}
		if(l+k>n-1){
			System.out.println(-1);
			System.exit(0);
		}
		for (int i = n-1; i>=0; i--) {
			if(k>0){mas[i] =a;a/=2;k--;}
			}
		for(int i=2;i<=l+1;i++){
			mas[i]+=b;
			b++;
		}
   print(mas);
	}

	String nextToken() throws IOException {
		if (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(bf.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void print(int a[]) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
	}

	public static void main(String args[]) throws IOException {
		new C().solution();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = null;

	private void solution() throws IOException {
		int n = nextInt();
		int l=nextInt();
		int k=nextInt();
		int a=50000;
		int b=2;
		int[] mas = new int[n];
		Arrays.fill(mas, 1);
		int i=1;
		if(n==1 && l==0 && k==0){
			System.out.println(1);
			System.exit(0);
		}
		if(l+1==n){
			System.out.println(-1);
			System.exit(0);
		}
		int cur=2;
		while(k-->0){
			mas[i]=cur;
			cur*=2;
			i++;
		}
		if(mas[1]==1 && l>0){
			i=2;
			mas[i]=2;
			i++;
			mas[i]=2;
		}
		cur/=2;
		cur++;
		int br=cur;
		while(l-->0){
			if(i<n){mas[i]=br;
			br++;
			i++;
			}
		}
	print(mas);
	}

	String nextToken() throws IOException {
		if (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(bf.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void print(int a[]) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
	}

	public static void main(String args[]) throws IOException {
		new C().solution();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = null;

	private void solution() throws IOException {
		int n = nextInt();
		int l=nextInt();
		int k=nextInt();
		int a=10000;
		int b=1;
		int[] mas = new int[n];
		Arrays.fill(mas, 1);
		if(l+k==n){
			System.out.println(-1);
			System.exit(0);
		}
		for (int i = n-1; i>=0; i--) {
			if(k>0){mas[i] =a;a/=2;k--;}
			}
		int cur=n-k;
		for(int i=1;i<=l;i++){
			mas[i]+=b;
			b++;
		}
   print(mas);
	}

	String nextToken() throws IOException {
		if (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(bf.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void print(int a[]) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
	}

	public static void main(String args[]) throws IOException {
		new C().solution();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = null;

	private void solution() throws IOException {
		int n = nextInt();
		int l=nextInt();
		int k=nextInt();
		int a=50000;
		int b=2;
		int[] mas = new int[n];
		Arrays.fill(mas, 1);
		mas[0]=2;
		if(k>0 && n>1){
			mas[1]=3;
			k--;
			b++;
		}
		if(l+k>n-1){
			System.out.println(-1);
			System.exit(0);
		}
		for (int i = n-1; i>=0; i--) {
			if(k>0){mas[i] =a;a/=2;k--;}
			}
		for(int i=2;i<=l+1;i++){
			if(n>i && mas[i]==1){mas[i]+=b;
			b++;
			}else{
				System.out.println(-1);
				System.exit(0);
			}
		}
   print(mas);
	}

	String nextToken() throws IOException {
		if (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(bf.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void print(int a[]) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
	}

	public static void main(String args[]) throws IOException {
		new C().solution();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = null;

	private void solution() throws IOException {
		int n = nextInt();
		int l=nextInt();
		int k=nextInt();
		int a=50000;
		int b=2;
		int[] mas = new int[n];
		Arrays.fill(mas, 1);
		int i=1;
		if(n==1 && l==0 && k==0){
			System.out.println(1);
			System.exit(0);
		}
		if(l+1==n){
			System.out.println(-1);
			System.exit(0);
		}
		int cur=2;
		while(k-->0){
			mas[i]=cur;
			cur*=2;
			i++;
		}
		if(mas[1]==1 && l>0){
			i=2;
			mas[i]=2;
			if(i+1<n)mas[i+1]=2;
		}
		cur/=2;
		cur++;
		int br=cur;
		while(l-->0){
			if(i<n){mas[i]=br;
			br++;
			i++;
			}
		}
	print(mas);
	}

	String nextToken() throws IOException {
		if (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(bf.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void print(int a[]) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
	}

	public static void main(String args[]) throws IOException {
		new C().solution();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Scanner;
import java.util.StringTokenizer;

public class B {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = null;

	private void solution() throws IOException {
		long ans = 0;
		double vp = nextInt();
		double vd = nextInt();
		double t = nextInt();
		double f = nextInt();
		double flag = nextInt();
		double resp = 0;
if(vp>vd){
	System.out.println(0);
	System.exit(0);
}
		resp = vp * t;
		while (resp < flag) {
			resp += resp / (vd - vp) * vp;
			if (resp < flag) {
				ans++;
				resp += (f + resp / vd) * vp;
			}else{
				break;
			}
		}
		System.out.println(ans);
	}

	String nextToken() throws IOException {
		if (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(bf.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void print(int a[]) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
	}

	public static void main(String args[]) throws IOException {
		new B().solution();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = null;

	private void solution() throws IOException {
		int n = nextInt();
		int l=nextInt();
		int k=nextInt();
		int a=50000;
		int b=2;
		int[] mas = new int[n];
		Arrays.fill(mas, 1);
		int i=1;
		if(a+1==n){
			System.out.println(-1);
			System.exit(0);
		}
		int cur=2;
		while(k-->0){
			mas[i]=cur;
			cur*=2;
			i++;
		}
		cur/=2;
		cur++;
		int br=cur;
		while(l-->0){
			mas[i]=br;
			br++;
			i++;
		}
	print(mas);
	}

	String nextToken() throws IOException {
		if (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(bf.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void print(int a[]) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
	}

	public static void main(String args[]) throws IOException {
		new C().solution();
	}
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();

		int []res = new int[n];
		res[0] = 200;
		if(n==1 && a==0 && b==0){
			out.println(200);
			return;
		}
		if(a+1==n){
			out.println(-1);
			return;
		}
		if(b==0){
			res[1] = 199;
			for(int i=2;i<n;i++){
				if(a>0){
					res[i] = res[i-1]+2;
					a--;
				}
				else{
					res[i] = res[i-1]-1;
				}
			}
			for(int i=0;i<res.length;i++){
				out.print(res[i]);
				if(i<res.length-1)
					out.print(" ");
			}
			out.println();
			return;
		}
		for(int i=1;i<n;i++){
			if(b>0){
				res[i] = res[i-1]*2+1;
				b--;
			}
			else if(a>0){
				res[i] = res[i-1]+1;
				a--;
			}
			else{
				res[i] = res[i-1]-1;
			}
		}
		for(int i=0;i<res.length;i++){
			out.print(res[i]);
			if(i<res.length-1)
				out.print(" ");
		}
		out.println();
	}
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt(){
        return Integer.parseInt(next());
    }

    }


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();

		int []res = new int[n];
		res[0] = 200;
		if(n==1 && a==0 && b==0){
			out.println(-1);
			return;
		}
		if(a+1==n){
			out.println(-1);
			return;
		}
		if(b==0){
			res[1] = 199;
			for(int i=2;i<n;i++){
				if(a>0){
					res[i] = res[i-1]+2;
					a--;
				}
				else{
					res[i] = res[i-1]-1;
				}
			}
			for(int i=0;i<res.length;i++){
				out.print(res[i]);
				if(i<res.length-1)
					out.print(" ");
			}
			out.println();
			return;
		}
		for(int i=1;i<n;i++){
			if(b>0){
				res[i] = res[i-1]*2+1;
				b--;
			}
			else if(a>0){
				res[i] = res[i-1]+1;
				a--;
			}
			else{
				res[i] = res[i-1]-1;
			}
		}
		for(int i=0;i<res.length;i++){
			out.print(res[i]);
			if(i<res.length-1)
				out.print(" ");
		}
		out.println();
	}
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt(){
        return Integer.parseInt(next());
    }

    }


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();

		int []res = new int[n];
		res[0] = 200;
		int prev = 200;
		if(a+1==n){
			out.println("-1");
			return;
		}
		if(b==0){
			res[1] = 199;
			for(int i=2;i<n;i++){
				if(a>0){
					res[i] = res[i-1]+1;
					a--;
				}
				else{
					res[i] = res[i-1];
				}
			}
			for(int i=0;i<res.length;i++){
				out.print(res[i]);
				if(i<res.length-1)
					out.print(" ");
			}
			out.println();
			return;
		}
		for(int i=1;i<n;i++){
			if(b>0){
				res[i] = prev+1;
				prev += res[i];
				b--;
			}
			else if(a>0){
				res[i] = res[i-1]+1;
				prev += res[i];
				a--;
			}
			else{
				res[i] = res[i-1]-1;
			}
		}
		for(int i=0;i<res.length;i++){
			out.print(res[i]);
			if(i<res.length-1)
				out.print(" ");
		}
		out.println();
	}
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt(){
        return Integer.parseInt(next());
    }

    }


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();

		int []res = new int[n];
		res[0] = 200;
		int prev = 200;
		if(a+1==n){
			out.println("-1");
			return;
		}
		if(b==0){
			res[1] = 199;
			for(int i=2;i<n;i++){
				if(a>0){
					res[i] = res[i-1]+2;
					a--;
				}
				else{
					res[i] = res[i-1];
				}
			}
			for(int i=0;i<res.length;i++){
				out.print(res[i]);
				if(i<res.length-1)
					out.print(" ");
			}
			out.println();
			return;
		}
		for(int i=1;i<n;i++){
			if(b>0){
				res[i] = prev+1;
				prev += res[i];
				b--;
			}
			else if(a>0){
				res[i] = res[i-1]+1;
				prev += res[i];
				a--;
			}
			else{
				res[i] = res[i-1]-1;
			}
		}
		for(int i=0;i<res.length;i++){
			out.print(res[i]);
			if(i<res.length-1)
				out.print(" ");
		}
		out.println();
	}
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt(){
        return Integer.parseInt(next());
    }

    }


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();

		int []res = new int[n];
		res[0] = 1;
		if(n==1 && a==0 && b==0){
			out.println(200);
			return;
		}
		if(a+1==n){
			out.println(-1);
			return;
		}
		if(b==0){
			res[1] = 1;
			for(int i=2;i<n;i++){
				if(a>0){
					res[i] = res[i-1]+1;
					a--;
				}
				else{
					res[i] = res[i-1]-1;
				}
			}
			for(int i=0;i<res.length;i++){
				out.print(res[i]);
				if(i<res.length-1)
					out.print(" ");
			}
			out.println();
			return;
		}
		for(int i=1;i<n;i++){
			if(b>0){
				res[i] = res[i-1]*2;
				b--;
			}
			else if(a>0){
				res[i] = res[i-1]+1;
				a--;
			}
			else{
				res[i] = res[i-1]-1;
			}
		}
		for(int i=0;i<res.length;i++){
			out.print(res[i]);
			if(i<res.length-1)
				out.print(" ");
		}
		out.println();
	}
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt(){
        return Integer.parseInt(next());
    }

    }


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();

		int []res = new int[n];
		res[0] = 1;
		if(n==1 && a==0 && b==0){
			out.println(200);
			return;
		}
		if(a+1==n){
			out.println(-1);
			return;
		}
		if(b==0){
			res[1] = 1;
			for(int i=2;i<n;i++){
				if(a>0){
					res[i] = res[i-1]+1;
					a--;
				}
				else{
					res[i] = res[i-1];
				}
			}
			for(int i=0;i<res.length;i++){
				out.print(res[i]);
				if(i<res.length-1)
					out.print(" ");
			}
			out.println();
			return;
		}
		for(int i=1;i<n;i++){
			if(b>0){
				res[i] = res[i-1]*2;
				b--;
			}
			else if(a>0){
				res[i] = res[i-1]+1;
				a--;
			}
			else{
				res[i] = res[i-1];
			}
		}
		for(int i=0;i<res.length;i++){
			out.print(res[i]);
			if(i<res.length-1)
				out.print(" ");
		}
		out.println();
	}
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt(){
        return Integer.parseInt(next());
    }

    }


import java.io.*;
import java.util.*;

public class Main {
   private static IO io;

   public static void main(String[] args) throws IOException {
       new Main().run();
   }

   private void run() throws IOException {
       io = new IO(System.getProperty("ONLINE_JUDGE")!=null);
       solve();
       io.flush();
   }

   private void solve() throws IOException {
       final int MAX = 50000;
       int n = io.nI(), a = io.nI(), b = io.nI()-1, at = a, bt = b+1, r[] = new int[n], i = 1, j; r[0] = 1;
       while(bt>0&&i<n&&r[i-1]<=MAX)r[i] = r[i++-1]*2+--bt*0;
       while(at>0&&i<n&&r[i-1]<=MAX)r[i] = r[i++-1]+1+--at*0;
       for(; i<n; i++)r[i] = 1;

       int max = r[0], sum = r[0];
       for(i = 1; i<n; i++){
           if(r[i]>sum)b--;else
               if(r[i]>max)
                   a--;
           sum+=r[i]; max = Math.max(max, r[i]);
       }
       if(a>0||b+1>0)io.wln(-1);else
           for(i = 0; i<n; i++)io.w(r[i]+" ");
   }//2.2250738585072012e-308

   @SuppressWarnings("unused")
   private class IO{
       StreamTokenizer in; PrintWriter out; BufferedReader br; Reader reader; Writer writer;
       public IO(boolean oj) throws IOException{
           Locale.setDefault(Locale.US);
           reader = oj ? new InputStreamReader(System.in) : new FileReader("input.txt");
           writer = oj ? new OutputStreamWriter(System.out) : new FileWriter("output.txt");
           br = new BufferedReader(reader);
           in = new StreamTokenizer(br);
           out = new PrintWriter(writer);
       }
       public void wln(){out.println();}
       public void wln(int arg){out.println(arg);}
       public void wln(long arg){out.println(arg);}
       public void wln(double arg){out.println(arg);}
       public void wln(String arg){out.println(arg);}
       public void wln(boolean arg){out.println(arg);}
       public void wln(char arg){out.println(arg);}
       public void wln(float arg){out.println(arg);}
       public void wln(Object arg){out.println(arg);}
       public void w(int arg){out.print(arg);}
       public void w(long arg){out.print(arg);}
       public void w(double arg){out.print(arg);}
       public void w(String arg){out.print(arg);}
       public void w(boolean arg){out.print(arg);}
       public void w(char arg){out.print(arg);}
       public void w(float arg){out.print(arg);}
       public void w(Object arg){out.print(arg);}
       public void wf(String format, Object...args){out.printf(format, args);}
       public void flush(){out.flush();}
       public int nI() throws IOException {in.nextToken(); return(int)in.nval;}
       public long nL() throws IOException {in.nextToken(); return(long)in.nval;}
       public String nS() throws IOException {in.nextToken(); return in.sval;}
       public double nD() throws IOException {in.nextToken(); return in.nval;}
       public float nF() throws IOException {in.nextToken(); return (float)in.nval;}
       public void wc(char...a){for(char c : a){in.ordinaryChar(c);in.wordChars(c, c);}}
       public void wc(char c1, char c2){in.ordinaryChars(c1, c2); in.wordChars(c1, c2);}
   }
}


import java.io.*;
import java.util.*;

public class Main {
   private static IO io;

   public static void main(String[] args) throws IOException {
       new Main().run();
   }

   private void run() throws IOException {
       io = new IO(System.getProperty("ONLINE_JUDGE")!=null);
       solve();
       io.flush();
   }

   private void solve() throws IOException {
       final int MAX = 50000;
       int n = io.nI(), a = io.nI(), b = io.nI()-1, at = a, bt = b+1, r[] = new int[n], i = 1, j; r[0] = 1;
       Arrays.fill(r, 1);
       if(b==-1&&a>0)i = 2;
       while(bt>0&&i<n&&r[i-1]<=MAX)r[i] = r[i++-1]*2+--bt*0;
       while(at>0&&i<n&&r[i-1]<=MAX)r[i] = r[i++-1]+1+--at*0;
       int max = r[0], sum = r[0]; at = 0; bt = 0;
       for(i = 1; i<n; i++){
           if(r[i]>sum)bt++;else
               if(r[i]>max)
                   at++;
           sum+=r[i]; max = Math.max(max, r[i]);
       }
       if(at!=a||bt-1!=b)io.wln(-1);else
           for(i = 0; i<n; i++)io.w(r[i]+" ");
   }//2.2250738585072012e-308

   @SuppressWarnings("unused")
   private class IO{
       StreamTokenizer in; PrintWriter out; BufferedReader br; Reader reader; Writer writer;
       public IO(boolean oj) throws IOException{
           Locale.setDefault(Locale.US);
           reader = oj ? new InputStreamReader(System.in) : new FileReader("input.txt");
           writer = oj ? new OutputStreamWriter(System.out) : new FileWriter("output.txt");
           br = new BufferedReader(reader);
           in = new StreamTokenizer(br);
           out = new PrintWriter(writer);
       }
       public void wln(){out.println();}
       public void wln(int arg){out.println(arg);}
       public void wln(long arg){out.println(arg);}
       public void wln(double arg){out.println(arg);}
       public void wln(String arg){out.println(arg);}
       public void wln(boolean arg){out.println(arg);}
       public void wln(char arg){out.println(arg);}
       public void wln(float arg){out.println(arg);}
       public void wln(Object arg){out.println(arg);}
       public void w(int arg){out.print(arg);}
       public void w(long arg){out.print(arg);}
       public void w(double arg){out.print(arg);}
       public void w(String arg){out.print(arg);}
       public void w(boolean arg){out.print(arg);}
       public void w(char arg){out.print(arg);}
       public void w(float arg){out.print(arg);}
       public void w(Object arg){out.print(arg);}
       public void wf(String format, Object...args){out.printf(format, args);}
       public void flush(){out.flush();}
       public int nI() throws IOException {in.nextToken(); return(int)in.nval;}
       public long nL() throws IOException {in.nextToken(); return(long)in.nval;}
       public String nS() throws IOException {in.nextToken(); return in.sval;}
       public double nD() throws IOException {in.nextToken(); return in.nval;}
       public float nF() throws IOException {in.nextToken(); return (float)in.nval;}
       public void wc(char...a){for(char c : a){in.ordinaryChar(c);in.wordChars(c, c);}}
       public void wc(char c1, char c2){in.ordinaryChars(c1, c2); in.wordChars(c1, c2);}
   }
}


import java.io.*;
import java.util.*;

public class Main {
   private static IO io;

   public static void main(String[] args) throws IOException {
       new Main().run();
   }

   private void run() throws IOException {
       io = new IO(System.getProperty("ONLINE_JUDGE")!=null);
       solve();
       io.flush();
   }

   private void solve() throws IOException {
       final int MAX = 50000;
       int n = io.nI(), a = io.nI(), b = io.nI()-1, at = a, bt = b+1, r[] = new int[n], i = 1, j; r[0] = 1;
       if(a>0&&b==-1){io.wln(-1); return;}
       while(bt>0&&i<n&&r[i-1]<=MAX)r[i] = r[i++-1]*2+--bt*0;
       while(at>0&&i<n&&r[i-1]<=MAX)r[i] = r[i++-1]+1+--at*0;
       if(at+bt>0){io.wln(-1); return;}
       for(; i<n; i++)r[i] = 1;
       for(i = 0; i<n; i++)io.w(r[i]+" ");
   }//2.2250738585072012e-308

   @SuppressWarnings("unused")
   private class IO{
       StreamTokenizer in; PrintWriter out; BufferedReader br; Reader reader; Writer writer;
       public IO(boolean oj) throws IOException{
           Locale.setDefault(Locale.US);
           reader = oj ? new InputStreamReader(System.in) : new FileReader("input.txt");
           writer = oj ? new OutputStreamWriter(System.out) : new FileWriter("output.txt");
           br = new BufferedReader(reader);
           in = new StreamTokenizer(br);
           out = new PrintWriter(writer);
       }
       public void wln(){out.println();}
       public void wln(int arg){out.println(arg);}
       public void wln(long arg){out.println(arg);}
       public void wln(double arg){out.println(arg);}
       public void wln(String arg){out.println(arg);}
       public void wln(boolean arg){out.println(arg);}
       public void wln(char arg){out.println(arg);}
       public void wln(float arg){out.println(arg);}
       public void wln(Object arg){out.println(arg);}
       public void w(int arg){out.print(arg);}
       public void w(long arg){out.print(arg);}
       public void w(double arg){out.print(arg);}
       public void w(String arg){out.print(arg);}
       public void w(boolean arg){out.print(arg);}
       public void w(char arg){out.print(arg);}
       public void w(float arg){out.print(arg);}
       public void w(Object arg){out.print(arg);}
       public void wf(String format, Object...args){out.printf(format, args);}
       public void flush(){out.flush();}
       public int nI() throws IOException {in.nextToken(); return(int)in.nval;}
       public long nL() throws IOException {in.nextToken(); return(long)in.nval;}
       public String nS() throws IOException {in.nextToken(); return in.sval;}
       public double nD() throws IOException {in.nextToken(); return in.nval;}
       public float nF() throws IOException {in.nextToken(); return (float)in.nval;}
       public void wc(char...a){for(char c : a){in.ordinaryChar(c);in.wordChars(c, c);}}
       public void wc(char c1, char c2){in.ordinaryChars(c1, c2); in.wordChars(c1, c2);}
   }
}


import java.io.*;
import java.util.*;

public class Main {
   private static IO io;

   public static void main(String[] args) throws IOException {
       new Main().run();
   }

   private void run() throws IOException {
       io = new IO(System.getProperty("ONLINE_JUDGE")!=null);
       solve();
       io.flush();
   }

   private void solve() throws IOException {
       final int MAX = 50000;
       int n = io.nI(), a = io.nI(), b = io.nI()-1, at = a, bt = b+1, r[] = new int[n], i = 1, j; r[0] = 1;
       while(bt>0&&i<n&&r[i-1]<=MAX)r[i] = r[i++-1]*2+--bt*0;
       while(at>0&&i<n&&r[i-1]<=MAX)r[i] = r[i++-1]+1+--at*0;
       for(; i<n; i++)r[i] = 1;
       for(i = 0; i<n; i++)io.w(r[i]+" ");
   }//2.2250738585072012e-308

   @SuppressWarnings("unused")
   private class IO{
       StreamTokenizer in; PrintWriter out; BufferedReader br; Reader reader; Writer writer;
       public IO(boolean oj) throws IOException{
           Locale.setDefault(Locale.US);
           reader = oj ? new InputStreamReader(System.in) : new FileReader("input.txt");
           writer = oj ? new OutputStreamWriter(System.out) : new FileWriter("output.txt");
           br = new BufferedReader(reader);
           in = new StreamTokenizer(br);
           out = new PrintWriter(writer);
       }
       public void wln(){out.println();}
       public void wln(int arg){out.println(arg);}
       public void wln(long arg){out.println(arg);}
       public void wln(double arg){out.println(arg);}
       public void wln(String arg){out.println(arg);}
       public void wln(boolean arg){out.println(arg);}
       public void wln(char arg){out.println(arg);}
       public void wln(float arg){out.println(arg);}
       public void wln(Object arg){out.println(arg);}
       public void w(int arg){out.print(arg);}
       public void w(long arg){out.print(arg);}
       public void w(double arg){out.print(arg);}
       public void w(String arg){out.print(arg);}
       public void w(boolean arg){out.print(arg);}
       public void w(char arg){out.print(arg);}
       public void w(float arg){out.print(arg);}
       public void w(Object arg){out.print(arg);}
       public void wf(String format, Object...args){out.printf(format, args);}
       public void flush(){out.flush();}
       public int nI() throws IOException {in.nextToken(); return(int)in.nval;}
       public long nL() throws IOException {in.nextToken(); return(long)in.nval;}
       public String nS() throws IOException {in.nextToken(); return in.sval;}
       public double nD() throws IOException {in.nextToken(); return in.nval;}
       public float nF() throws IOException {in.nextToken(); return (float)in.nval;}
       public void wc(char...a){for(char c : a){in.ordinaryChar(c);in.wordChars(c, c);}}
       public void wc(char c1, char c2){in.ordinaryChars(c1, c2); in.wordChars(c1, c2);}
   }
}


import java.util.Scanner;

public class sample {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] arr = new int[n];
        int at = 0;

        int sum = 1;
        for (int i = 0; i < b; i++) {
            if (at == 0)
                arr[at++] = 1;
            if (sum + 1 > 50000) {
                System.out.println("-1");
                System.exit(0);
            }
            arr[at++] = sum + 1;
            sum += sum + 1;
        }
        int x;
        for (int i = 0; i < a; i++) {
            x = arr[at-1];
            if (at == 0) {
                arr[at++] = 2;
                arr[at++] = 1;
                x = 2;
            }
            if (at >= n) {
                System.out.println(-1);
                System.exit(0);
            }

            arr[at++] = x + 1;
        }
        for (int i = at; i < n; i++)
            arr[i] = 1;
        String s = "";
        for (int i = 0; i < n; i++) {
            s += " " + arr[i];
        }
        System.out.println(s.substring(1));
    }
}


import java.util.Scanner;

public class sample {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] arr = new int[n];
        int at = 0;
        arr[at++] = 1;
        for (int i = 0; i < a; i++)
            arr[at++] = i + 2;
        int sum = 0;
        for (int i = 0; i < at; i++)
            sum += arr[i];
        for (int i = 0; i < b; i++) {
            arr[at++] = sum + 1;
            sum += sum + 1;
        }
        for (int i = at; i < n; i++)
            arr[i] = 1;

        for (int i = 0; i < n - 1; i++) {
            System.out.print(arr[i] + " ");
        }
        System.out.println(arr[n - 1]);
    }
}


import java.util.Scanner;

public class sample {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] arr = new int[n];
        int at = 0;

        int sum = 1;
        for (int i = 0; i < b; i++) {
            if (at == 0)
                arr[at++] = 1;
            if (sum + 1 > 50000) {
                System.out.println("-1");
                System.exit(0);
            }
            arr[at++] = sum + 1;
            sum += sum + 1;
        }
        int x;
        for (int i = 0; i < a; i++) {
        if(at!=0)
            x = arr[at-1];
            if (at == 0) {
                arr[at++] = 2;
                arr[at++] = 1;
                x = 2;
            }
            if (at >= n) {
                System.out.println(-1);
                System.exit(0);
            }

            arr[at++] = x + 1;
        }
        for (int i = at; i < n; i++)
            arr[i] = 1;
        String s = "";
        for (int i = 0; i < n; i++) {
            s += " " + arr[i];
        }
        System.out.println(s.substring(1));
    }
}


import java.util.Scanner;

public class sample {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] arr = new int[n];
        int at = 0;

        int sum = 1;
        for (int i = 0; i < b; i++) {
            if (at == 0)
                arr[at++] = 1;
            if (sum + 1 > 50000) {
                System.out.println("-1");
                System.exit(0);
            }
            arr[at++] = sum + 1;
            sum += sum + 1;
        }
        int x;
        for (int i = 0; i < a; i++) {
            if (at == 0) {
                arr[at++] = 2;
                arr[at++] = 1;
                x = 1;
            }
            if (at >= n) {
                System.out.println(-1);
                System.exit(0);
            }
            x = arr[at-1];
            arr[at++] = x + 1;
        }
        for (int i = at; i < n; i++)
            arr[i] = 1;
        String s = "";
        for (int i = 0; i < n; i++) {
            s += " " + arr[i];
        }
        System.out.println(s.substring(1));
    }
}


import java.util.Scanner;

public class sample {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] arr = new int[n];
        int at = 0;
        arr[at++] = 1;
        for (int i = 0; i < a; i++)
            arr[at++] = i + 2;
        int sum = 0;
        for (int i = 0; i < at; i++)
            sum += arr[i];
        for (int i = 0; i < b; i++) {
            if (sum + 1 > 50000) {
                System.out.println("-1");
                System.exit(0);
            }
            arr[at++] = sum + 1;
            sum += sum + 1;
        }
        for (int i = at; i < n; i++)
            arr[i] = 1;
        String s = "";
        for (int i = 0; i < n; i++) {
            s += " " + arr[i];
        }
        System.out.println(s.substring(1));
    }
}


import java.util.Scanner;

public class CC {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] arr = new int[n];
        int at = 0;

        int sum = 1;
        for (int i = 0; i < b; i++) {
            if (at == 0)
                arr[at++] = 1;
            if (sum + 1 > 50000) {
                System.out.println("-1");
                System.exit(0);
            }
            arr[at++] = sum + 1;
            sum += sum + 1;
        }
        int x;
        for (int i = 0; i < a; i++) {
            if (at != 0)
                x = arr[at - 1];
            else{
                arr[at++] = 2;
                arr[at++] = 1;
                x = 2;
            }
            if (at >= n) {
                System.out.println(-1);
                System.exit(0);
            }

            arr[at++] = x + 1;
        }
        for (int i = at; i < n; i++)
            arr[i] = 1;
        String s = "";
        for (int i = 0; i < n; i++) {
            s += " " + arr[i];
        }
        System.out.println(s.substring(1));
    }
}


import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int[] arr = new int[n];
        arr[0] = 1;
        int sum = 1;
        int max = 1;
        int index = 1;
        while (b > 0) {
            arr[index] = sum + 1;
            sum += arr[index];
            max = arr[index];
            index++;
            b--;
        }
        while (a > 0) {
            arr[index] = max + 1;
            max = arr[index];
            index++;
            a--;
        }
        while (index < n) {
            arr[index] = arr[index - 1];
            index++;
        }
        if (arr[n - 1] <= 50000) {
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    System.out.print(" ");
                }
                System.out.print(arr[i]);
            }
            System.out.println();
        }
        else {
            System.out.println(-1);
        }
    }
}


import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int[] arr = new int[n];
        arr[0] = 1;
        int sum = 1;
        int max = 1;
        int index = 1;
        while (b > 0) {
            arr[index] = sum + 1;
            sum += arr[index];
            max = arr[index];
            index++;
            b--;
        }
        while (a > 0) {
            arr[index] = max + 1;
            max = arr[index];
            index++;
            a--;
        }
        while (index < n) {
            arr[index] = arr[index - 1];
            index++;
        }
        if (arr[n - 1] < 50000) {
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    System.out.print(" ");
                }
                System.out.print(arr[i]);
            }
            System.out.println();
        }
        else {
            System.out.println(-1);
        }
    }
}


import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int[] arr = new int[n];
        arr[0] = 1;
        int sum = 1;
        int max = 1;
        int index = 1;
        while (b > 0) {
            arr[index] = sum + 1;
            sum += arr[index];
            max = arr[index];
            index++;
            b--;
        }
        while (a > 0) {
            int temp = max + 1;
            if (temp > sum) {
                int diff = (temp - sum) / index + 2;
                for (int i = 0; i < index; i++) {
                    arr[i] += 2;
                    sum += 2;
                }
                max += 2;
            }
            arr[index] = max + 1;
            max = arr[index];
            sum += arr[index];
            index++;
            a--;
        }
        while (index < n) {
            arr[index] = 1;
            index++;
        }
        if (arr[n - 1] <= 50000) {
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    System.out.print(" ");
                }
                System.out.print(arr[i]);
            }
            System.out.println();
        }
        else {
            System.out.println(-1);
        }
    }
}


import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int[] arr = new int[n];
        arr[0] = 1;
        int sum = 1;
        int max = 1;
        int index = 1;
        while (b > 0) {
            arr[index] = sum + 1;
            sum += arr[index];
            max = arr[index];
            index++;
            b--;
        }
        while (a > 0 && index < n) {
            int temp = max + 1;
            if (temp > sum) {
                if (index == 1) {
                    arr[index] = 1;
                    sum += arr[index];
                    index++;
                    continue;
                }
                int diff = (temp - sum) / index + 2;
                for (int i = 0; i < index; i++) {
                    arr[i] += 2;
                    sum += 2;
                }
                max += 2;
            }
            arr[index] = max + 1;
            max = arr[index];
            sum += arr[index];
            index++;
            a--;
        }
        if (a > 0) {
            System.out.println(-1);
            return;
        }
        while (index < n) {
            arr[index] = 1;
            index++;
        }
        if (arr[n - 1] <= 50000) {
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    System.out.print(" ");
                }
                System.out.print(arr[i]);
            }
            System.out.println();
        }
        else {
            System.out.println(-1);
        }
    }
}


import java.io.*;

public class test {

	public static void main(String[] args) throws Exception {

		int n = nextInt();
		int a = nextInt();
		int b = nextInt();
		int i;
		for(i = 0; i < b; i++){
			print((int)Math.pow(2, i) + " ");
			n--;
		}
		int c = 1;
		while(a-- >= 0){
			print((int)Math.pow(2, i) + c++ + " ");
			n--;
		}
		while(n-- > 0) print("1 ");

	}

	private static PrintWriter out;
	private static BufferedReader inB;
	private static boolean FILE = false;

	static {
		try {
			out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
			inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("billboards.txt") : System.in));
		} catch(Exception e) {e.printStackTrace();}
	}

	private static StreamTokenizer in = new StreamTokenizer(inB);

	private static void exit(Object o) throws Exception {
		out.println(o);
		out.flush();
		System.exit(0);
	}
	private static void println(Object o) throws Exception{
		out.println(o);
		out.flush();
	}
	private static void print(Object o) throws Exception{
		out.print(o);
		out.flush();
	}
	private static int nextInt() throws Exception {
		in.nextToken();
		return (int)in.nval;
	}
	private static String nextString() throws Exception {
		in.nextToken();
		return in.sval;
	}
}


import java.io.*;

public class test {

	public static void main(String[] args) throws Exception {
  		int n = nextInt();
		int a = nextInt();
		int b = nextInt();
		int i;
		if(n == a + 1) exit("-1");
		for(i = 0; i <= b; i++){
			print((int)Math.pow(2, i) + " ");
			n--;
		}
		i--;
		int c = 1;
		while(a-- > 0){
			print((int)Math.pow(2, i) + c++ + " ");
			n--;
		}
		while(n-- > 0) print("1 ");
	}

	private static PrintWriter out;
	private static BufferedReader inB;
	private static boolean FILE = false;

	static {
		try {
			out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
			inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("billboards.txt") : System.in));
		} catch(Exception e) {e.printStackTrace();}
	}

	private static StreamTokenizer in = new StreamTokenizer(inB);

	private static void exit(Object o) throws Exception {
		out.println(o);
		out.flush();
		System.exit(0);
	}
	private static void println(Object o) throws Exception{
		out.println(o);
		out.flush();
	}
	private static void print(Object o) throws Exception{
		out.print(o);
		out.flush();
	}
	private static int nextInt() throws Exception {
		in.nextToken();
		return (int)in.nval;
	}
	private static String nextString() throws Exception {
		in.nextToken();
		return in.sval;
	}
}


import java.io.*;

public class test {

	public static void main(String[] args) throws Exception {

  		int n = nextInt();
		int a = nextInt();
		int b = nextInt();
		int i;
		for(i = 0; i <= b; i++){
			print((int)Math.pow(2, i) + " ");
			n--;
		}
		i--;
		int c = 1;
		while(a-- > 0){
			print((int)Math.pow(2, i) + c++ + " ");
			n--;
		}
		while(n-- > 0) print("1 ");

//		int vp = nextInt();
//		int vd = nextInt();
//		int t = nextInt();
//		int f = nextInt();
//		int c = nextInt();
//		int res = 0;
//		int prNow = vp * t;
//		int drNow = 0;
//		int time = t;
//		while(true){
//			if(prNow >= c) break;
//			prNow += vp;
//			drNow += vd;
//			if(prNow >= c) break;
//			if(drNow >= prNow){
//				res++;
//				prNow += vp*(drNow / vd + f);
//				drNow = 0;
//			}
//		}
//		exit(res);
	}

	private static PrintWriter out;
	private static BufferedReader inB;
	private static boolean FILE = false;

	static {
		try {
			out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
			inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("billboards.txt") : System.in));
		} catch(Exception e) {e.printStackTrace();}
	}

	private static StreamTokenizer in = new StreamTokenizer(inB);

	private static void exit(Object o) throws Exception {
		out.println(o);
		out.flush();
		System.exit(0);
	}
	private static void println(Object o) throws Exception{
		out.println(o);
		out.flush();
	}
	private static void print(Object o) throws Exception{
		out.print(o);
		out.flush();
	}
	private static int nextInt() throws Exception {
		in.nextToken();
		return (int)in.nval;
	}
	private static String nextString() throws Exception {
		in.nextToken();
		return in.sval;
	}
}


import java.io.*;

public class test {

	public static void main(String[] args) throws Exception {

		int n = nextInt();
		int a = nextInt();
		int b = nextInt();
		int i = 1;
		for(i = 1; i <= a+1; i++){
			print(i + " ");
			n--;
		}
		i--;
		int pr = 1;
		while(b-- > 0){

			print( (i*(i+1))/2 + pr + " ");
			i++;
			pr+=(i*(i+1))/2;
			n--;
		}
		while(n-- > 0) print("1 ");

	}

	private static PrintWriter out;
	private static BufferedReader inB;
	private static boolean FILE = false;

	static {
		try {
			out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
			inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("billboards.txt") : System.in));
		} catch(Exception e) {e.printStackTrace();}
	}

	private static StreamTokenizer in = new StreamTokenizer(inB);

	private static void exit(Object o) throws Exception {
		out.println(o);
		out.flush();
		System.exit(0);
	}
	private static void println(Object o) throws Exception{
		out.println(o);
		out.flush();
	}
	private static void print(Object o) throws Exception{
		out.print(o);
		out.flush();
	}
	private static int nextInt() throws Exception {
		in.nextToken();
		return (int)in.nval;
	}
	private static String nextString() throws Exception {
		in.nextToken();
		return in.sval;
	}
}


import java.io.*;

public class test {

	public static void main(String[] args) throws Exception {
  		int n = nextInt();
		int a = nextInt();
		int b = nextInt();
		int i = 0;
		int ns = n;
		int c = 1;
		if(n == a + 1 && n > 1) exit("-1");
		if(b == 0 && a !=0 ){
			while( n > a ){
				n--;
				print("1 ");
			}
			while(a-- > 0){
				print((int)Math.pow(2, i) + c++ + " ");
				n--;
			}
		}
		for(i = 0; i < b; i++){
			print((int)Math.pow(2, i) + " ");
			n--;
		}
		while(a-- > 0){
			print((int)Math.pow(2, i) + c++ + " ");
			n--;
		}
		while(n-- > 0) print("1 ");
	}

	private static PrintWriter out;
	private static BufferedReader inB;
	private static boolean FILE = false;

	static {
		try {
			out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
			inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("billboards.txt") : System.in));
		} catch(Exception e) {e.printStackTrace();}
	}

	private static StreamTokenizer in = new StreamTokenizer(inB);

	private static void exit(Object o) throws Exception {
		out.println(o);
		out.flush();
		System.exit(0);
	}
	private static void println(Object o) throws Exception{
		out.println(o);
		out.flush();
	}
	private static void print(Object o) throws Exception{
		out.print(o);
		out.flush();
	}
	private static int nextInt() throws Exception {
		in.nextToken();
		return (int)in.nval;
	}
	private static String nextString() throws Exception {
		in.nextToken();
		return in.sval;
	}
}


import java.io.*;

public class test {

	public static void main(String[] args) throws Exception {
  		int n = nextInt();
		int a = nextInt();
		int b = nextInt();
		int i = 0;
		int ns = n;
		int c = 1;
		if(n == a + 1 && n > 1) exit("-1");
		if(b == 0 && a !=0 ){
			while( n > a ){
				n--;
				print("1 ");
			}
			while(a-- > 0){
				print((int)Math.pow(2, i) + c++ + " ");
				n--;
			}
		}
		for(i = 0; i < b; i++){
			print((int)Math.pow(2, i) + " ");
			n--;
		}
		while(a-- >= 0){
			print((int)Math.pow(2, i) + c++ + " ");
			n--;
		}
		while(n-- > 0) print("1 ");
	}

	private static PrintWriter out;
	private static BufferedReader inB;
	private static boolean FILE = false;

	static {
		try {
			out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
			inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("billboards.txt") : System.in));
		} catch(Exception e) {e.printStackTrace();}
	}

	private static StreamTokenizer in = new StreamTokenizer(inB);

	private static void exit(Object o) throws Exception {
		out.println(o);
		out.flush();
		System.exit(0);
	}
	private static void println(Object o) throws Exception{
		out.println(o);
		out.flush();
	}
	private static void print(Object o) throws Exception{
		out.print(o);
		out.flush();
	}
	private static int nextInt() throws Exception {
		in.nextToken();
		return (int)in.nval;
	}
	private static String nextString() throws Exception {
		in.nextToken();
		return in.sval;
	}
}


import java.io.*;

public class test {

	public static void main(String[] args) throws Exception {
  		int n = nextInt();
		int a = nextInt();
		int b = nextInt();
		int i;
		if(n == a + 1 && n > 1) exit("-1");
		for(i = 0; i <= b; i++){
			print((int)Math.pow(2, i) + " ");
			n--;
		}
		i--;
		int c = 1;
		while(a-- > 0){
			print((int)Math.pow(2, i) + c++ + " ");
			n--;
		}
		while(n-- > 0) print("1 ");
	}

	private static PrintWriter out;
	private static BufferedReader inB;
	private static boolean FILE = false;

	static {
		try {
			out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
			inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("billboards.txt") : System.in));
		} catch(Exception e) {e.printStackTrace();}
	}

	private static StreamTokenizer in = new StreamTokenizer(inB);

	private static void exit(Object o) throws Exception {
		out.println(o);
		out.flush();
		System.exit(0);
	}
	private static void println(Object o) throws Exception{
		out.println(o);
		out.flush();
	}
	private static void print(Object o) throws Exception{
		out.print(o);
		out.flush();
	}
	private static int nextInt() throws Exception {
		in.nextToken();
		return (int)in.nval;
	}
	private static String nextString() throws Exception {
		in.nextToken();
		return in.sval;
	}
}