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