function code(a: string; f: integer): string; var e: string; b: char; c, d: integer; begin d := 1; e := ''; while d <= length(a) do begin b := a[d]; c := ord(b); c := c + f; b := chr(c); e := e + b; d := d + 1; end; Result := e; end; function decode(a:string; f:integer):string; var e: string; b: char; c, d: integer; begin d := 1; e := ''; while d <= length(a) do begin b := a[d]; c := ord(b); c := c - f; b := chr(c); e := e + b; d := d + 1; end; Result := e; end; var a, b, c: string; f: integer; begin randomize; f:=random(1, 10); read(a); b := code(a, f); writeLn(b); c := decode(b, f); writeLn(c); end.