program Zadatak1;

uses
    Classes,
    SysUtils;

type
    StringArray6 = array[0..5] of string;

procedure SplitText(const s: String; StringList: TStringList);
begin
    StringList.Delimiter := ' ';
    StringList.DelimitedText := s;
end;

function CombineStrings(const strings: TStringList): TStringList;
var
    resultx: TStringList;
    i: integer;
begin
    resultx := TStringList.create;
    for i:=0 to strings.Count-1 do
    begin
        resultx.Add(Concat(strings.ValueFromIndex[i], strings.ValueFromIndex[(i+1) mod 3], strings.ValueFromIndex[(i+2) mod 3]));
        resultx.Add(Concat(strings.ValueFromIndex[i], strings.ValueFromIndex[(i+2) mod 3], strings.ValueFromIndex[(i+1) mod 3]));
    end;
    CombineStrings := resultx;
end;

function MaxValue(const strings: TStringList): Real;
var
    resulte: Real = 0;
    temp: Real = 0;
    code: integer = 0;
    i: integer;
begin
    for i:=0 to strings.Count-1 do
    begin
        Val(strings.ValueFromIndex[i], temp, code);
        if temp > resulte then
            resulte := temp;
    end;
    writeln();
    MaxValue := resulte;
end;

var
    InputLine: String;
    StringList, StringCombos: TStringList;
    Largest: Real = 0;
    i: integer;

begin
    readln(InputLine);

    StringList := TStringList.create;
    SplitText(InputLine, StringList);
    StringCombos := CombineStrings(StringList);

    Largest := MaxValue(StringCombos);
    writeln(Largest);
    readln;
end.