var f: boolean;
i, k, min: integer;
c, cnew : char;
s: string;
begin
s:= '';
min:=250; k:=0;
f:=false;
repeat
 read(c);
 s:=s+c;
 if f then {слово началось}
   if c in ['a'..'z','A'..'Z']
    then k:=k+1
    else begin
        if k<min then min:=k;
          f:=false;
    end
 else  {f=false}
  if c in ['a'..'z','A'..'Z']
   then begin f:=true;  k:=1 end;
until c='.';
for i:=1 to length(s) do
begin
 cnew:=chr(ord(s[i])+min);
 case s[i] of
   'a'..'z': if cnew > 'z' then write(chr(ord(cnew)-26))
     else write(cnew);
   'A'..'Z': if cnew > 'Z' then write(chr(ord(cnew)-26))
     else write(cnew);
   else write(s[i])
 end
end;
readln
end.

