#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,e;
	cin>>d;
	a=d%10;
	b=d/10%10;
	c=d/100;
	if(a>b&&a>c&&b>c)e=a*100+b*10+c;
	if(a>b&&a>c&&c>b)e=a*100+c*10+b;
	if(b>a&&b>c&&a>c)e=b*100+a*10+c;
	if(b>a&&b>c&&c>a)e=b*100+c*10+a;
	if(c>b&&c>a&&b>a)e=c*100+b*10+a;
	if(c>b&&c>a&&a>b)e=c*100+a*10+b;
	cout<<e;
	return 0;
}
/**************************************************************
	Problem: 1042
	User: panyuchen
	Language: C++
	Result: Accepted
	Time:9 ms
	Memory:2072 kb
****************************************************************/