program Project1;
var a,b,c,s,d,f,g,h,j:string;
 max, x,x1,x2,x3,x4,x5,m,y,n,i,q:integer;
  begin
   writeln('unesi prvi broj');
   readln(a);
   writeln('unesi drugi broj');
   readln(b);
   writeln('unesi treci broj');
   readln(c);
   s:=a+b+c;
   d:=a+c+b;
   f:=b+a+c;
   g:=b+c+a;
   h:=c+a+b;
   j:=c+b+a;

   n:=length(s);
   x:=0;
   m:=1;
   i:=1;
   for q:=n downto i do
   begin
     y:=ord(s[q])-48;
     x:=x+y*m;
     m:=m*10;
  end;

    n:=length(d);
   x1:=0;
   m:=1;
   i:=1;
   for q:=n downto i do
   begin
     y:=ord(d[q])-48;
     x1:=x1+y*m;
     m:=m*10;
  end;

    n:=length(f);
   x2:=0;
   m:=1;
   i:=1;
   for q:=n downto i do
   begin
     y:=ord(f[q])-48;
     x2:=x2+y*m;
     m:=m*10;
  end;

    n:=length(g);
   x3:=0;
   m:=1;
   i:=1;
   for q:=n downto i do
   begin
     y:=ord(g[q])-48;
     x3:=x3+y*m;
     m:=m*10;
  end;

    n:=length(h);
   x4:=0;
   m:=1;
   i:=1;
   for q:=n downto i do
   begin
     y:=ord(h[q])-48;
     x4:=x4+y*m;
     m:=m*10;
  end;

    n:=length(j);
   x5:=0;
   m:=1;
   i:=1;
   for q:=n downto i do
   begin
     y:=ord(s[q])-48;
     x5:=x5+y*m;
     m:=m*10;
  end;

   max:=0;
   if x>max then max:=x1;
   if x1>max then max:=x1;
   if x2>max then max:=x2;
   if x3>max then max:=x3;
   if x4>max then max:=x4;
   if x5>max then max:=x5;
   writeln('najveci je ',max);
   readln;

  end.