program Rot13;
{$mode delphi}{$apptype console}
uses SysUtils;
var s: string; i: Integer; c: Char;
begin
  Write('Текст: '); ReadLn(s);
  for i := 1 to Length(s) do begin
    c := s[i];
    if (c >= 'A') and (c <= 'Z') then s[i] := Chr((Ord(c) - Ord('A') + 13) mod 26 + Ord('A'))
    else if (c >= 'a') and (c <= 'z') then s[i] := Chr((Ord(c) - Ord('a') + 13) mod 26 + Ord('a'));
  end;
  WriteLn('ROT13: ', s);
  ReadLn;
end.
