#include <iostream>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
if (a > b) {
int aux = a;
a = b;
b = aux;
}
if (a > c) {
int aux = a;
a = c;
c = aux;
}
if (a > d) {
int aux = a;
a = d;
d = aux;
}
if (b > c) {
int aux = b;
b = c;
c = aux;
}
if (b > d) {
int aux = b;
b = d;
d = aux;
}
if (c > d) {
int aux = c;
c = d;
d = aux;
}
cout << a << " " << b << " " << c << " " << d;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBpbnQgYSwgYiwgYywgZDsKICAgIGNpbiA+PiBhID4+IGIgPj4gYyA+PiBkOwogICAgaWYgKGEgPiBiKSB7CiAgICAgICAgaW50IGF1eCA9IGE7CiAgICAgICAgYSA9IGI7CiAgICAgICAgYiA9IGF1eDsKICAgIH0KICAgIGlmIChhID4gYykgewogICAgICAgIGludCBhdXggPSBhOwogICAgICAgIGEgPSBjOwogICAgICAgIGMgPSBhdXg7CiAgICB9CiAgICBpZiAoYSA+IGQpIHsKICAgICAgICBpbnQgYXV4ID0gYTsKICAgICAgICBhID0gZDsKICAgICAgICBkID0gYXV4OwogICAgfQogICAgaWYgKGIgPiBjKSB7CiAgICAgICAgaW50IGF1eCA9IGI7CiAgICAgICAgYiA9IGM7CiAgICAgICAgYyA9IGF1eDsKICAgIH0KICAgIGlmIChiID4gZCkgewogICAgICAgIGludCBhdXggPSBiOwogICAgICAgIGIgPSBkOwogICAgICAgIGQgPSBhdXg7CiAgICB9CiAgICBpZiAoYyA+IGQpIHsKICAgICAgICBpbnQgYXV4ID0gYzsKICAgICAgICBjID0gZDsKICAgICAgICBkID0gYXV4OwogICAgfQogICAgY291dCA8PCBhIDw8ICIgIiA8PCBiIDw8ICIgIiA8PCBjIDw8ICIgIiA8PCBkOwogICAgcmV0dXJuIDA7Cn0=