#include<iostream>
#include<vector>
#include<set>
using namespace std;
vector<int> lista(2023, 0);
vector<pair<int, int>> syote;
set<int> loputluvut;
int kasitellyt_luvut = 0;
vector<int> p(2024, 0);
vector<int> v;
int summa = 0;
int mika = 0;
bool loytynyt = false;
void haku() {
if (loytynyt == true)return;
else if (summa > syote[mika].first) return;
else if (v.size() == 43) {
if (summa == syote[mika].first && loytynyt == false) {
for (int i = 0; i < 43; i++) {
lista[i] = v[i];
loputluvut.insert(v[i]);
kasitellyt_luvut++;
}
loytynyt = true;
}
else return;
}
else {
for (int i = 1; i <= 2023; i++) {
if (p[i] == 1) continue;
if (loputluvut.count(i) == 1) continue;
p[i] = 1;
v.push_back(i);
haku();
p[i] = 0;
v.pop_back();
}
}
}
int main() {
for (int i = 0; i < 100; i++) {
int x;
cin >> x;
syote.push_back({ x, i });
}
haku();
for (int i = kasitellyt_luvut; i < 2023; i++) {
for (int j = 1; j <= 2023; j++) {
if (loputluvut.count(j) == 0) {
lista[i] = j;
loputluvut.insert(j);
break;
}
}
}
for (int i : lista) cout << i << " ";
}