#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
int A = min(a, min(b, c));
int C = max(a, max(b, c));
int B = a + b + c - A - C;
printf("%d\n%d\n%d\n", A, B, C);
puts("");
printf("%d\n%d\n%d\n", a, b, c);
return 0;
}