#include <iostream>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
// Verificăm primul număr
if (a <= b && a <= c && a <= d) {
cout << a << " ";
if (b <= c && b <= d) {
cout << b << " ";
if (c <= d) {
cout << c << " " << d << endl;
}
else {
cout << d << " " << c << endl;
}
}
else if (c <= b && c <= d) {
cout << c << " ";
if (b <= d) {
cout << b << " " << d << endl;
}
else {
cout << d << " " << b << endl;
}
}
else {
cout << d << " ";
if (b <= c) {
cout << b << " " << c << endl;
}
else {
cout << c << " " << b << endl;
}
}
}
// Verificăm al doilea număr
else if (b <= a && b <= c && b <= d) {
cout << b << " ";
if (a <= c && a <= d) {
cout << a << " ";
if (c <= d) {
cout << c << " " << d << endl;
}
else {
cout << d << " " << c << endl;
}
}
else if (c <= a && c <= d) {
cout << c << " ";
if (a <= d) {
cout << a << " " << d << endl;
}
else {
cout << d << " " << a << endl;
}
}
else {
cout << d << " ";
if (a <= c) {
cout << a << " " << c << endl;
}
else {
cout << c << " " << a << endl;
}
}
}
// Verificăm al treilea număr
else if (c <= a && c <= b && c <= d) {
cout << c << " ";
if (a <= b && a <= d) {
cout << a << " ";
if (b <= d) {
cout << b << " " << d << endl;
}
else {
cout << d << " " << b << endl;
}
}
else if (b <= a && b <= d) {
cout << b << " ";
if (a <= d) {
cout << a << " " << d << endl;
}
else {
cout << d << " " << a << endl;
}
}
else {
cout << d << " ";
if (a <= b) {
cout << a << " " << b << endl;
}
else {
cout << b << " " << a << endl;
}
}
}
// Verificăm al patrulea număr
else {
cout << d << " ";
if (a <= b && a <= c) {
cout << a << " ";
if (b <= c) {
cout << b << " " << c << endl;
}
else {
cout << c << " " << b << endl;
}
}
else if (b <= a && b <= c) {
cout << b << " ";
if (a <= c) {
cout << a << " " << c << endl;
}
else {
cout << c << " " << a << endl;
}
}
else {
cout << c << " ";
if (a <= b) {
cout << a << " " << b << endl;
}
else {
cout << b << " " << a << endl;
}
}
}
return 0;
}