#include <iostream>
void rearrange( int& a, int& b, int& c ) // void if there is nothing to return
{
int aux ;
if( a > b ) { aux = a ; a = b ; b = aux ; }
if( b > c ) { aux = b ; b = c ; c = aux ; }
if( a > b ) { aux = a ; a = b ; b = aux ; }
}
int main()
{
int a, b, c ;
std::cin >> a >> b >> c ;
std::cout << "before: " << a << ' ' << b << ' ' << c << '\n' ;
rearrange( a, b, c ) ;
std::cout << " after: " << a << ' ' << b << ' ' << c << '\n' ;
}