{$A+,B-,D+,E-,F-,G+,I+,L+,N+,O-,P-,Q+,R+,S+,T-,V+,X+}
{$M 16384,0,655360}
program Ispakuokime;
{ VTGTM lic‚jaus             }
{ 3c kurso mokinio           }
{ Lauryno Biveinio           }
{ 2-ojo u‘davinio sprendimas }

{ ­d‚ja: atkei‡iame dviej— simboli— kombinacijas  da‘niausiai }
{ pasitaikan‡ius ‘od‘ius Paskalio programose. Nieko geresnio nesugalvojau.  }

const
    DuomFailoVardas = 'progr.pak';
    RezFailoVardas = 'progr.kap';
    KiekZodziu = 30;
    Zodziai : array[1..KiekZodziu] of String = ('PROGRAM', 'UNIT', 'INTERFACE',
    'IMPLEMENTATION', 'CONST', 'TYPE', 'BEGIN', 'REPEAT', 'UNTIL', 'WHILE',
    'PROCEDURE', 'FUNCTION', 'INTEGER', 'BOOLEAN', 'WRITE', 'CHAR', 'READ',
    'WRITELN', 'READLN', 'THEN', 'ELSE', 'STRING', 'ARRAY', 'FILE', 'TEXT',
    'END', 'FOR', 'TRUE', 'FALSE', 'VAR');
    VPak : array[1..KiekZodziu] of String[2] = ('|A', '|B', '|C',
    '|D', '|E', '|F', '|G', '|H', '|I', '|J',
    '|K', '|L', '|M', '|N', '|O', '|P', '|R',
    '|S', '|T', '|U', '|V', '|X', '|Q', '|Y', '|Z',
    '|0', '|1', '|2', '|3', '|4');

type
    ChFile = File of Char;

var
    DuomFailas : ChFile;
    RezFailas : Text;
    Eilute : String;
    Eil : String;
    IRasem : Boolean;
    Zodis : Word;
    i : Word;
    Dydis : LongInt;
    DarSkaityti : Boolean;
    j : Byte;

function SkEil(var f : ChFile; ilgis : byte) : String;
var
  Rez : String;
  i : Byte;
  S : char;
begin
  Rez := '';
  for i := 1 to Ilgis do
     begin
        Read(f, S);
        Rez := Rez + S;
        if Eof(f)
           then break;
     end;
  SkEil := Rez
end;

function LyginkZodzius(Zodis, Eil : String) : Boolean;
   var
      Lygus : Boolean;
      index : Byte;
begin
   Lygus := True;
   for index := 1 to Length(Zodis) do
      if Zodis[index] <> Eil[index]
        then begin
                Lygus := False;
                Break
             end;
   LyginkZodzius := Lygus
end;

begin
    Assign(DuomFailas, DuomFailoVardas);
    Reset(DuomFailas);
    Assign(RezFailas, RezFailoVardas);
    Rewrite(RezFailas);
    i := 0;
    dydis := FileSize(DuomFailas);
    DarSkaityti := True;
    j := 1;
    while (j <= 1) do
       begin
          if DarSkaityti
              then Eilute := SkEil(DuomFailas, 2)
              else begin
                     Eilute := Copy(Eil, j + 1, 2 - j);
                     Inc(j)
                   end;
          Inc(i);
          IRasem := False;
          for Zodis := 1 to KiekZodziu do
              if LyginkZodzius(VPak[Zodis], Eilute)
                 then begin
                         Write(RezFailas, Zodziai[Zodis]);
                         IRasem := True;
                         if DarSkaityti
                           then Inc(I)
                           else Inc(j);
                         break
                 end;
          if not Irasem and Eof(DuomFailas) and DarSkaityti then begin
             Eil := Eilute;
             DarSkaityti := False;
          end;
          if not Irasem then Write(RezFailas, Eilute[1]);
          if not Eof(DuomFailas) then Seek(DuomFailas, i);
       end;
    Close(DuomFailas);
    Close(RezFailas);
end.{
  Vygintas Daugmaudis
  KurÕÓnÖ Lauryno Ivinskio gimnazija
  2Ra klasÓ
  UØdavinys nr. 1
}

program archyvavimas;

const
  INPUT_NAME = 'progr.pak';
  OUTPUT_NAME = 'progr.kap';


function mask (str: string): string;
type
  mask_record = record
                  real_name, mask_name: string
                end;
const
  MAX = 14;

  mask_array: array[0..MAX - 1] of mask_record =
   ((real_name: 'program'; mask_name: '!p'),
    (real_name: 'procedure'; mask_name: '!pc'),
    (real_name: 'function'; mask_name: '!f'),
    (real_name: 'begin'; mask_name: '!b'),
    (real_name: 'while'; mask_name: '!w'),
    (real_name: 'repeat'; mask_name: '!r'),
    (real_name: 'until'; mask_name: '!u'),
    (real_name: 'var'; mask_name: '!v'),
    (real_name: 'then'; mask_name: '!t'),
    (real_name: 'else'; mask_name: '!e'),
    (real_name: 'random'; mask_name: '!ra'),
    (real_name: 'writeln'; mask_name: '!wl'),
    (real_name: 'readln'; mask_name: '!rl'),
    (real_name: 'unit'; mask_name: '!un'));

var
  i: integer;
begin
  mask := str;
  i := 0;
  while (i < MAX - 1) and (mask_array[i].mask_name <> str) do
    inc (i);
  if mask_array[i].mask_name = str then mask := mask_array[i].real_name
end;

procedure add_spaces (var st: string; var rez: string);
var
  i, sk, err: integer;
begin
  delete (st, 1, 1);
  val (st, sk, err);
  if err <> 0 then begin
                     st := '!' + st;
                     exit
                   end;

  for i := 1 to sk do
    rez := rez + ' ';

  st := ''
end;

procedure unpack;
var
  input, output: text;
  tmp, tmp1: char;
  line, orriginal_line: string;

begin
  assign (input, INPUT_NAME);
  reset (input);
  assign (output, OUTPUT_NAME);
  rewrite (output);

  read (input, tmp);
  while not eof (input) do
    begin
      orriginal_line := '';
      repeat
        if tmp = '!' then begin
                            line := tmp;
                            read (input, tmp1);
                            while tmp1 <> ' ' do
                              begin
                                line := line + tmp1;
                                read (input, tmp1)
                              end;
                            if line = '!#13' then begin
                                                    read (input, tmp);
                                                    break
                                                  end;
                            add_spaces (line, orriginal_line);
                            if line <> mask (line) then line := mask (line) + ' ';
                            orriginal_line := orriginal_line + line;
                          end
                     else orriginal_line := orriginal_line + tmp;
        read (input, tmp)
      until false or eof (input);
      writeln (output, orriginal_line)
    end;
  writeln (output, 'end.');


  close (input);
  close (output)
end;

begin
  unpack
end.{ Vaidas Didvalis
  Gra‘ižki— vidurin‚ mokykla
  12 klas‚
  antras u‘davinys           }

{id‚ja: da‘niausiai vartojamus ‘od‘ius pakeisti sutartiniais simboliais }

program arch2;



const kiek = 121;
const mas : array[1..kiek] of string =
(
'implementation',
'              ',
'             ',
'            ',
'           ',
'set of char',
'constructor',
'          ',
'destructor',
'of integer',
'of boolean',
'then begin',
'procedure ',
'         ',
'procedure',
'inherited',
'interface',
'function ',
'        ',
'function',
':integer',
':boolean',
'putpixel',
'getpixel',
'uses crt',
'uses dos',
'       ',
':string',
'file of',
'longint',
'boolean',
'exports',
'library',
'integer',
'program',
'rewrite',
'writeln',
'nosound',
'      ',
'circle',
'readln',
'object',
'downto',
'inline',
'packed',
'record',
'repeat',
'string',
'assign',
'yallow',
'upcase',
'     ',
'sound',
'write',
'while',
'array',
'begin',
'const',
'label',
'until',
'false',
'close',
'color',
'green',
'delay',
'    ',
'line',
'blue',
'name',
'read',
'case',
'else',
'file',
'goto',
'then',
'type',
'unit',
'uses',
'word',
'byte',
'with',
'text',
'true',
'char',
'   ',
'mod ',
'div ',
'var ',
'end.',
'end;',
' <> ',
' <= ',
' >= ',
' := ',
'get',
'put',
'and',
'asm',
'end',
'for',
'nil',
'not',
'set',
'shl',
'shr',
'xor',
'ord',
' x ',
' i ',
':=x',
':=i',
' = ',
'<> ',
'<= ',
'>= ',
' <>',
' <=',
' >=',
' :=',
' : ',
':= '

);



var f : file of char;
    f2 : text;
    x, p : integer;
    s: string;
    ss: char;


    c : string;



begin
assign(f, 'progr.pak');
reset(f);
assign(f2, 'progr.kap');
rewrite(f2);

while not eof(f) do
begin
  read(f, ss);
  if ss <>chr(0) then write (f2, ss)
     else begin
           read(f, ss);
           write(f2, mas[ord(ss)]);
          end;

end;
close(f2);
close(f);


end.program unpack;
  const BlockSize = 2048;
  type psaka = ^saka;
        saka = record
                 v, n : psaka; { vienetukas nuliukas }
                 s : char;     { simbolis }
               end;

  var fi : file;
      fo : text;
      block : array [0..BlockSize-1] of byte;
      exist : array [0..31] of byte;
      i, j, k : word;

      prad, asaka, bsaka : psaka;
      stri : string;
begin
  new (prad);
  prad^.v := nil;
  prad^.n := nil;
  { susidarome med }
  assign (fi, 'progr.pak');
  {$I-}
  reset (fi, 1);
  {$I+}
  blockread (fi, exist, 32);
  for i := 0 to 255 do
    if exist[i shr 3] shr (i and 7) and 1 = 1
      then
        begin
          blockread (fi, k, 2);
          blockread (fi, block, (k+7) shr 3);
          asaka := prad;
          for j := 0 to k-1 do
            if block[j shr 3] shr (j and 7) and 1 = 1
               then
                 begin
                   if asaka^.v = nil
                     then
                       begin
                         new (bsaka);
                         bsaka^.v := nil;
                         bsaka^.n := nil;
                         asaka^.v := bsaka;
                       end;
                   asaka := asaka^.v;
                 end
               else
                 begin
                   if asaka^.n = nil
                     then
                       begin
                         new (bsaka);
                         bsaka^.v := nil;
                         bsaka^.n := nil;
                         asaka^.n := bsaka;
                       end;
                   asaka := asaka^.n;
                 end;
          asaka^.s := chr (i);
        end;
  { dekoduojame fail… }
  assign (fo,'progr.kap');
  rewrite (fo);
  asaka := prad;
  stri := '';
  repeat
    blockread (fi, block, BlockSize, k);
    if k <> 0
      then
        begin
          for i := 0 to k-1 do
            for j := 0 to 7 do
              begin
                if block[i] shr j and 1 = 1
                  then asaka := asaka^.v
                  else asaka := asaka^.n;
                if (asaka^.v = nil) and (asaka^.n = nil)
                  then
                    begin
                      if asaka^.s = #13
                        then
                          begin
                            if stri[0] <> #0
                              then
                                begin
                                  while stri[ord(stri[0])] = #32 do
                                    stri[0] := chr(ord(stri[0])-1);
                                  if stri[0] <> #0
                                    then writeln (fo, stri);
                                  stri[0] := #0;
                                end
                              else writeln (fo);
                          end
                        else
                          begin
                            stri[0] := chr(ord(stri[0])+1);
                            stri[ord(stri[0])] := asaka^.s;
                          end;
                      asaka := prad;
                    end;
              end;
        end;
  until k = 0;
  while stri[ord(stri[0])] = #32 do
    stri[0] := chr(ord(stri[0])-1);
  if stri[0] <> #0
    then writeln (fo, stri);
  close (fo);
  close (fi);
end.{$A+,B-,D+,E+,F-,G+,I+,L+,N+,O-,P-,Q-,R-,S+,T-,V+,X+}
{$M 16384,0,655360}
{
Aleksej Drovnenkov
Visagino "Sedulinos" vidurin‚ mokykla
12 "A" klas‚
Pirmas u‘davinys
}

program drovn1;

  function stepen2 (t : integer) : integer;
    begin
      if t=0 then stepen2:=1
        else stepen2:=2*stepen2(t-1);
    end;

  type ttext = array[1..65000] of char;
       rtext = array[1..65000] of byte;
       ptext = ^ttext;
       ctext = ^rtext;

  var
    test : array[1..32] of integer;
    archcode, currbyte : byte;
    tmpint : longint;
    likobits : integer;
    rz  : text;
    pr : file of byte;
    failas : ptext;
    outfailas : ctext;
    skait : byte;
    skait2 : char;
    counter, counter2, counter3, tsize, tofor, tofor2 : longint;
    tempbuf : array[1..201] of byte;
    mode : byte;

begin
  assign (pr,'PROGR.PAK');
  assign (rz,'PROGR.KAP');
  new (failas);
  new (outfailas);
  reset (pr);
  rewrite (rz);

  counter:=0;
  while (not eof(pr)) do
    begin
      read (pr,skait);
      outfailas^[counter+1]:=skait;
      counter:=counter+1;
    end;
  tofor:=1; {outfailas}
  counter2:=1;  {failas}

  while (tofor<counter) do
    begin
      if (outfailas^[tofor]>128) then
        begin
          for tofor2:=1 to outfailas^[tofor]-128 do
            begin
              failas^[tofor2+counter2-1]:=chr(outfailas^[tofor+tofor2]);
            end;
          counter2:=counter2+outfailas^[tofor]-128;
          tofor:=tofor+outfailas^[tofor]-128+1;
        end;

      if (outfailas^[tofor]<128) then
        begin
          tmpint:=outfailas^[tofor];
          likobits:=8;
          counter3:=tofor+1;
          for tofor2:=1 to tmpint do
           begin

              if likobits>=5 then
                begin
                  archcode:=outfailas^[counter3];
                  archcode:=archcode mod (stepen2(likobits));
                  archcode:=archcode shr (likobits-5);
                end;

              if likobits<5 then
                begin
                  archcode:=outfailas^[counter3];
                  archcode:=archcode mod (stepen2(likobits));
                  archcode:=archcode shl (5-likobits);
                  archcode:=archcode+((outfailas^[counter3+1] div (stepen2(likobits+3))));
                end;

              likobits:=likobits-5;

              if likobits<=0 then
                begin
                  likobits:=likobits+8;
                  counter3:=counter3+1;
                end;

              if archcode<26 then skait2:=chr(65+archcode);
              if archcode=27 then skait2:=' ';
              if archcode=28 then skait2:=':';
              if archcode=29 then skait2:=';';
              if archcode=30 then skait2:=',';
              if archcode=31 then skait2:='=';
              if archcode=26 then skait2:=chr(13);
              failas^[counter2]:=skait2;
              if archcode=26 then begin
                                    counter2:=counter2+1;
                                    failas^[counter2]:=chr(10);
                                  end;
              counter2:=counter2+1;
            end;
           tofor:=tofor+((tmpint*5) div 8);
           if ((tmpint *5) mod 8)<>0 then tofor:=tofor+1;
           tofor:=tofor+1;
         end;
     end;

    for tofor:=1 to (counter2-1) do write (rz, failas^[tofor]);

    dispose (failas);
    dispose (outfailas);
    close (pr);
    close (rz);
end.{ M.Bir‘ižkos gimnazijos     }
{ 2 GD klas‚s mokinio        }
{ Justo Janausko             }
{ XI informatios olimpiados  }
{ III etapo II dalies        }
{ I u‘davinio sprendimas     }

const
  strIn = 'progr.pak';
  strOut = 'progr.kap';
  mx = 2555;
type
  TWords = array [1..mx] of String[20];
var
  Words: TWords;
  wc: Integer;

function Spaces(a: Integer): String;
var
  r: String;
  i: Integer;
begin
  r := '';
  for i := 1 to a do
    r := r + ' ';
  Spaces := r;
end;

procedure ReadData;
var
  a: Integer;
  f, fout: Text;
  c, c2: Char;
  s: String;
begin
  Assign(f, strIn);
  Reset(f);
  Assign(fout, strOut);
  Rewrite(fout);
  Read(f, wc);
  Read(f, c);
  for a := 1 to wc do
  begin
    s := '';
    Read(f, c);
    while c <> ' ' do
    begin
      s := s + c;
      Read(f, c);
    end;
    words[a] := s;
  end;
  ReadLn(f);
  while not EOF(f) do
  begin
    Read(f, c);
    s := '';
    if c in [#0..#10] then
    begin
      Read(f, c2);
      s := words[Ord(c)*255+ord(c2)];
    end else
      if c = #13 then
        s := #13#10
      else
        if c = #252 then
          s := ':='
        else
          if c = #251 then
            s := ', '
          else
            if c = #254 then
            begin
              Read(f, c2);
              s := Spaces(Ord(c2));
            end else
              if c = #253 then
                s := '  '
              else
                if c = #250 then
                  s := ');'
                else
                  if c = #249 then
                    s := '<>'
                  else
                    if c = #248 then
                      s := '>='
                    else
                      if c = #247 then
                        s := '<='
                      else
                        if c = #246 then
                          s := ': '
                        else
                            s := c;
    Write(fout, s)
  end;

  Close(f);
  Close(fout);
end;

begin
  ReadData;
end.{
Eimantas JATKONIS
KTU Gimnazija
4c klasós mokinio
Kaunas

1 uýdavinys
S - i÷pakuojanti programa
}

{$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,P-,Q+,R+,S+,T-,V+,X+}
{$M 16384,0,655360}

Program IsPakuoja;
var
     i, j, x, y : integer;
     kur, ilg, ilgt, viso : integer;
     tyr, rez, pap : string;
     kas : char;
     okas : integer;
     coms : array[1..200] of string;

     may : string;
     fd, fr : text;

begin
   coms[1] := ' ELSE';
   coms[2] := 'ELSE';
   coms[3] := 'END;';
   coms[4] := 'END.';
   coms[5] := 'END';
   coms[6] := 'PROGRAM';
   coms[7] := 'STRING;';
   coms[8] := 'STRING';
   coms[9] := 'INTEGER;';
   coms[10] := '   ';
   coms[11] := 'LONGINT;';
   coms[12] := 'LONGINT';
   coms[13] := '   ';
   coms[14] := 'BYTE;';
   coms[15] := 'CHAR;';
   coms[16] := 'CHAR';
   coms[17] := 'LABAS';
   coms[18] := ' : ';
   coms[19] := 'MOKYKLA';
   coms[20] := 'GIMNAZIJA';
   coms[21] := 'TEXT;';
   coms[22] := 'TEXT';
   coms[23] := 'ARRAY';
   coms[24] := 'VAR';
   coms[25] := 'WRITELN(';
   coms[26] := '   ';
   coms[27] := 'WRITE(';
   coms[28] := 'WRITE';
   coms[29] := 'READLN(';
   coms[30] := 'READLN';
   coms[31] := 'READ(';
   coms[32] := 'READKEY';
   coms[33] := 'LENGTH';
   coms[34] := 'UPCASE';
   coms[35] := 'DELETE';
   coms[36] := 'INSERT';
   coms[37] := 'REPEAT';
   coms[38] := 'UNTIL';
   coms[39] := 'KEYPRESSED';
   coms[40] := 'RESET(';
   coms[41] := 'RESET';
   coms[42] := 'REWRITE(';
   coms[43] := 'REWRITE';
   coms[44] := 'CLOSE(';
   coms[45] := 'CLOSE';
   coms[46] := 'TURBO';
   coms[47] := 'PASCAL';
   coms[48] := 'UNIT';
   coms[49] := 'USES';
   coms[50] := 'CONSTRUCTOR';
   coms[51] := 'INTERFACE';
   coms[52] := 'TYPE';
   coms[53] := 'PROCEDURE';
   coms[54] := 'FUNCTION';
   coms[55] := 'OBJECT';
   coms[56] := 'CONST';
   coms[57] := 'IMPLEMENTATION';
   coms[58] := 'BACKGROUND';
   coms[59] := 'FILE';
   coms[60] := 'HALT';
   coms[61] := 'READ';
   coms[62] := 'RESOLUTION';
   coms[63] := 'COLOR';
   coms[64] := 'I, J';
   coms[65] := 'GRAPH';
   coms[66] := 'CASE';
   coms[67] := 'WHILE ';
   coms[68] := 'QUICK';
   coms[69] := 'SORT';
   coms[70] := 'RANDOMIZE';
   coms[71] := 'RANDOM';
   coms[72] := ' THEN';
   coms[73] := 'THEN';
   coms[74] := 'BORLAND';
   coms[75] := 'COPYRIGHT';
   coms[76] := 'INTERNATIONAL';
   coms[77] := 'LIST';
   coms[78] := 'GENERAT';
   coms[79] := ' IF ';
   coms[80] := ' AND ';
   coms[81] := 'MEMORY';
   coms[82] := ' I:=';
   coms[83] := 'WHILE';
   coms[84] := 'FOR ';
   coms[85] := 'FOR';
   coms[86] := ' := ';
   coms[87] := 'EIMANTAS';
   coms[89] := 'JATKONIS';
   coms[90] := 'KAUNAS';
   coms[91] := 'OLIMIADA';
   coms[92] := 'ASSIGN(';
   coms[93] := 'ASSIGN';
   coms[94] := ' NOT ';
   coms[95] := 'NOT ';
   coms[96] := 'OEF(';
   coms[97] := 'DOWNTO';
   coms[98] := 'BEGIN';
   coms[99] := '.PAS';
   coms[100] := ' DO';
   coms[101] := ' + ';
   coms[102] := ' / ';
   coms[103] := ' * ';
   coms[104] := ' - ';
   coms[105] := 'WRITELN';
   coms[106] := 'BYTE';
   coms[107] := 'INTEGER';
   coms[109] := 'SAVE';
   coms[110] := 'ORDER';
   coms[111] := ' MENU';
   coms[112] := ' DATE';
   coms[113] := ' COUNT';
   coms[114] := 'MENU';
   coms[115] := 'DATE';
   coms[116] := 'COUNTER';
   coms[117] := 'EDIT';
   coms[118] := 'MEMO';
   coms[119] := 'DESTRUCTOR';
   coms[120] := 'WINDOW';
   coms[121] := 'VIRTUAL';
   coms[122] := 'EVENT';
   coms[123] := 'APPLICATION';
   coms[124] := 'APP';
   coms[125] := 'CLIPBOARD';
   coms[126] := 'CENCEL';
   coms[127] := 'YES';
   coms[128] := 'ENTER';
   coms[129] := 'ESC';
   coms[130] := 'LOAD';
   coms[131] := 'NUMBER';
   coms[132] := 'OPEN';
   coms[133] := 'ERROR';
   coms[134] := 'MESSAGE';
   coms[135] := 'SIZEOF';
   coms[136] := 'NEW';
   coms[137] := 'INIT';
   coms[138] := 'COUNT';
   coms[139] := 'COMMAND';
   coms[140] := 'TUTOR';
   coms[141] := 'DIRECTORY';
   coms[142] := 'OPTION';
   coms[143] := 'NAME';
   coms[144] := 'SIZE';
   coms[145] := 'DISPLAY';
   coms[146] := 'TIME';
   coms[147] := 'GET';
   coms[148] := 'PATH';
   coms[149] := 'DIR';
   coms[150] := 'WIDE';
   coms[151] := 'NUMSTR';
   coms[152] := 'NUM';
   coms[153] := 'INC';
   coms[154] := 'DEC';
   coms[155] := 'BOOLEAN;';
   coms[156] := 'BOOLEAN';
   coms[157] := 'LESS';
   coms[158] := 'IF ';
   coms[159] := 'ATTR';
   coms[160] := 'FIND';
   coms[161] := 'MOVE';
   coms[162] := 'NEXT';
   coms[163] := 'COPY';
   coms[164] := 'DISK';
   coms[165] := 'FREE';
   coms[166] := 'ORD(';
   coms[167] := 'CHR(';
   coms[168] := 'MAX';
   coms[169] := 'MIN';
   coms[170] := ' DIV ';
   coms[171] := ' MOD ';
   coms[172] := 'PTR';
   coms[173] := ' < ';
   coms[174] := ' > ';
   coms[175] := 'CRTDEMO';
   coms[176] := 'CRT';
   coms[177] := 'GOTOXY';
   coms[178] := 'LINETO';
   coms[179] := 'LINE';
   coms[180] := 'WHERE';
   coms[181] := 'LAST';
   coms[182] := 'MODE';
   coms[183] := 'VIDEO';
   coms[184] := ' OR ';
   coms[185] := 'CURSOR';
   coms[186] := 'POSIT';
   coms[187] := 'EXIT';
   coms[188] := 'ORIGINAL';
   coms[189] := 'WORD';
   coms[190] := 'BLACK';
   coms[191] := 'WHITE';
   coms[192] := 'DEL';
   coms[193] := 'INS';
   coms[194] := 'WIDTH';
   coms[195] := 'HEIGHT';
   coms[196] := 'CLRSCR';
   coms[197] := 'FALSE';
   coms[198] := 'TRUE';
   coms[199] := 'SCREEN';

   viso := 199;


   Assign(fd, 'progr.pak');
   Reset(fd);

   Assign(fr, 'progr.kap');
   ReWrite(fr);

   while not eof(fd) do
   begin
      ReadLn(fd,tyr);

      {atgaminam komandas}
      while pos(#254,tyr)>0 do
      begin
        kur := pos(#254,tyr);
        kas := tyr[kur+1];
        okas := ord(kas);
        delete(tyr,kur,2);
        insert(coms[okas],tyr,kur);
      end;

      {atgaminam tarpus}
      while pos(#255,tyr)>0 do
      begin
        kur := pos(#255,tyr);
        kas := tyr[kur+1];
        okas := ord(kas);
        if okas>=26 then okas := okas - 1;
        if okas>=13 then okas := okas - 1;
        delete(tyr,kur,2);
        may := '';
        for i := 1 to okas do may := may + ' ';
        insert(may,tyr,kur);
      end;

      {atgaminam komandas}
      for i := 1 to length(tyr) do
      begin
        if tyr[i]=#253 then
        begin
          kas := tyr[i+1];
          okas := ord(kas);
          delete(tyr,i,2);
          if okas = 3 then may := #253;
          if okas = 2 then may := #254;
          if okas = 1 then may := #255;
          insert(may,tyr,i);
        end;
      end;

      rez := tyr;
      WriteLn(fr, rez);
   end;


   Close(fd);
   Close(fr);
end.



{
                    Kauno J.Jablonskio gimnazijos
                    4A (12A) klasós mokinio
                    Arvydo Ju÷kevißiaus
                    1 Uýdavinys
                    I÷pakavimas
}

                                                                                {$M 64384,0,655360}
var
  simb: set of char;
  map: array [32..200] of String;
  map_sk: integer;
procedure PradiniaiDuomenys;
begin
{   simb := ['A'..'Z','0'..'9'];}
   map[32] := 'BEGIN';
   map[33] := 'END;';
   map[34] := 'INTERFACE';
   map[35] := 'IMPLEMENTATION';
   map[36] := 'STRING';
   map[37] := 'INTEGER';
   map[38] := 'CHAR';
   map[39] := 'SET';
   map[40] := 'PROCEDURE';
   map[41] := 'ARRAY';

   map[43] := 'APPEND';
   map[44] := 'CASE';
   map[45] := 'USES';
   map[46] := 'ASM';
   map[47] := 'END';
   map[48] := 'ARCCOS';
   map[49] := 'ARCCOORDS';
   map[50] := 'ARCTAN';
   map[51] := 'ARCSIN';
   map[52] := 'ARC';
   map[53] := 'ASSEMBLER';
   map[54] := 'BACKGROUND';
   map[55] := 'BAR3D';
   map[56] := 'BAR';
   map[57] := 'BOOLEAN';
   map[58] := 'CHECKBREAK';
   map[59] := 'CENTERTEXT';
   map[60] := 'CENTER';
   map[61] := 'CHAR';
   map[62] := 'CHDIR';
   map[63] := 'BREAK';
   map[64] := 'CHR';
   map[65] := 'CIRCLE';
   map[66] := 'CLEARDEVICE';
   map[67] := 'CLOSEGRAPH';
   map[68] := 'CLOSE';
   map[69] := 'COLOR';
   map[70] := 'CONCAT';
   map[71] := 'CONSTRUCTOR';
   map[72] := 'COPY';
   map[73] := 'CREATEDIR';
   map[74] := 'DELAY';
   map[75] := 'DESTRUCTOR';
   map[76] := 'DETECTGRAPH';
   map[77] := 'DISKFREE';
   map[78] := 'DISKSIZE';
   map[79] := 'DOWNTO';
   map[80] := 'USES';
   map[81] := 'ERROR';
   map[82] := 'EXEC';
   map[83] := 'EXIT';
   map[84] := 'ERASE';
   map[85] := 'ELSE';
   map[86] := 'THEN';
   map[87] := 'FILE';
   map[88] := 'PALETTE';
   map[89] := 'FUNCTION';
   map[90] := 'GETMAXX';
   map[91] := 'GETMAXY';
   map[92] := 'GOTO';
   map[93] := 'GETX';
   map[94] := 'GETY';
   map[95] := 'GETPIXEL';

   map[97] := 'INITGRAPH';
   map[98] := 'LENGTH';
   map[99] := 'LONGINT';
   map[100] := 'MAXINT';
   map[101] := 'MAXLONGINT';
   map[102] := 'MOVETO';
   map[103] := 'MKDIR';
   map[104] := 'MIN';
   map[105] := 'MAX';
   map[106] := 'ORD';
   map[107] := 'OUTTEXTXY';
   map[108] := 'OUTTEXT';
   map[109] := 'TEXT';
   map[110] := 'PARAMCOUNT';
   map[111] := 'PARAMSTR';
   map[112] := 'POS';
   map[113] := 'PUTPIXEL';
   map[114] := 'PROCEDURE';
   map[115] := 'RANDOM';
   map[116] := 'READLN(';
   map[117] := 'READ(';
   map[118] := 'REAL';
   map[119] := 'REPEAT';
   map[120] := 'SETFILL';
   map[121] := 'STRCAT';
   map[122] := 'STRCOMP';
   map[123] := 'STRCOPY';
   map[124] := 'SOUND';
   map[125] := 'TEXT';
   map[126] := 'UNIT';
   map[127] := 'UNTIL';
   map[128] := 'UPCASE';
   map[129] := 'USES';
   map[130] := 'VAR';
   map[131] := 'WHEREX';
   map[132] := 'WHEREY';
   map[133] := 'WHILE';
   map[134] := 'WRITELN(';
   map[135] := 'WRITE(';
   map[136] := 'WRITELN';
   map[137] := 'WRITE';
   map[138] := 'READLN';
   map[139] := 'READ';
   map[140] := ' := ';
   map[141] := ' + ';
   map[142] := ' - ';
   map[143] := ' * ';
   map[144] := ' / ';
   map[145] := 'TRUE';
   map[146] := 'FALSE';
   map[147] := 'ASSIGN(';
   map[148] := 'FOR';
   map[149] := 'DELETE';
   map[150] := ' TO ';
   map[151] := 'IF NOT';
   map[152] := 'IF';
   map[153] := 'NOT';
   map[154] := 'BYTE';

   map_sk := 154;
end;


procedure Darbas;
var
  F_in, F_out: Text;
  c,c_senas: Char;
  temp, s: String;

  zodis, rado, reikia: Boolean;
  i, j: integer;
  vieta: Byte;

  sk: integer;

begin
   Assign(F_in,  'progr.pak');
   Assign(F_out, 'progr.kap');
   Reset(F_in);
   Rewrite(F_out);
   Zodis := True;

   repeat
      ReadLn(F_in,s);
      i := 0;
      temp := '';

      if s <> '' then begin

         repeat
            i := 1 + i;
            case s[i] of
               {kazkokia komanda}
               '`' : begin
                        i := i + 1;
                        case s[i] of
                           '`': begin
                                  temp := temp + '`';
                                end;

                           '*': begin
                                  i := i + 1;
                                  for j := 1 to ord(s[i]) do
                                     temp := temp + s[i + 1];
                                  i := i + 1;
                                end;
                           else begin
                              temp := temp + map[ord(s[i])];
                           end;

                        end;

                     end;
               else temp := temp + s[i];
            end;
         until i >= length(s);
      end;

      if not EOF(F_in)
         then Writeln(F_out,temp)
         else Write(F_out,temp);

   until Eof(F_in);


   Close(F_in);
   Close(F_out);
end;

BEGIN
   PradiniaiDuomenys;
   Darbas;
END.{$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,P-,Q-,R-,S-,T-,V+,X+}
{$M 16384,0,655360}

program ak_unpacker;

const
  max_table = 2048;
  STD_EOD = 'a';
  STD_RST = 'b';

type
  PString = ^String;
  PInteger = ^Integer;

var
  f: file;
  fo: text;
  last_index, last_found: Integer;
  dSeg, dOfs, dPos, fs, last_tab: Word;
  tab: array[256..max_table] of PString;
  dat: Pointer;
  xfile: string;
function nEOD: Boolean;
begin
  nEOD := dPos < fs;
end;

function read_it: string;
var
  i: Integer;
begin
  i := PInteger(Ptr(dSeg, dOfs+dPos))^;
  Inc(dPos,2);
  if i < 256 then read_it := chr(i) else
  if i <= last_tab then read_it := tab[i]^
  else read_it := '';
end;

procedure cat(var s: string; c: char);
var
  l: byte;
begin
  l := succ(length(s));
  s[0] := chr(l);
  s[l] := c;
end;

procedure add_up(const s: string);
begin
  inc(last_tab);
  GetMem(tab[last_tab], length(s)+1);
  tab[last_tab]^ := s;
end;

procedure write_out(const s: string);
begin
  write(fo, s);
  xfile := xfile + s;
  if length(xfile) > 50 then xfile := copy(xfile, 40, 255);
end;

procedure unpack_it;
var
  st, nst: string;
 procedure str_init;
 var
   i: integer;
 begin
   st := read_it;
   for i := 256 to last_tab do
     FreeMem(tab[i], ord(pchar(tab[i])^)+1);
   last_tab := 255;
{   for i := 0 to 255 do
   add_up(chr(i)+chr(i));}
 end;
begin
  str_init;
  while nEOD do
  begin
    nst := read_it;
    if nst = '' then nst := st+st[1];
    if nst = STD_RST then
      str_init
    else
    if nst <> STD_EOD then
    begin
      write_out(st);
      cat(st, nst[1]);
      add_up(st);
      st := nst;
    end;
  end;
  if st <> '' then write_out(st);
end;

begin
  assign(f, 'PROGR.PAK');
  reset(f, 1);
  fs := FileSize(f);
  GetMem(dat, fs);
  dSeg := Seg(dat^); dOfs := Ofs(dat^);
  BlockRead(f, dat^, fs);
  close(f);
  assign(fo, 'PROGR.KAP');
  rewrite(fo);
  unpack_it;
  close(fo);
  FreeMem(dat, fs);
end.
{Panevóýio Juozo Balßikonio gimnazijos
10 klasós mokinio Martyno Kriaußiûno
I uýdavinio sprendimas}
{I÷pakuojanti programa}
{$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,P-,Q+,R+,S+,T-,V+,X+}
{$M 16384,0,655360}
Program Kodavimas;

  Const Duom_byla = 'Progr.Pak';
        Ats_byla = 'Progr.Kap';

  Type Sar = ^Sarasas;
       Sarasas = Record
         R : Char;
         N, V : Sar;
       End;
       Tip = Record
         S : Sar;
         I : Word;
       End;
       Stri = String [ 100 ];

  Var S : Sar;
      M : Array [ 0 .. 255 ] Of Tip;
      Sim, Simb : Word;
      C : Array [ 0 .. 255 ] Of Stri;

  procedure sort(l,r: longint);
var
  i,j,x: LongInt;
  Y : Tip;
begin
  i:=l; j:=r; x:=M[(l+r) DIV 2]. I;
  repeat
    while M[i]. I>x do i:=i+1;
    while x>M[j]. I do j:=j-1;
    if i<=j then
    begin
      y:=M[i]; M[i]:=M[j]; M[j]:=y;
      i:=i+1; j:=j-1;
    end;
  until i>j;
  if l<j then sort(l,j);
  if i<r then sort(i,r);
end;

  Procedure Medis;
    Var Si : Word;
        S1 : Sar;
  Begin
    Si := Sim;
    While Si <> 0 Do
      Begin
        New ( S1 );
        S1^. N := M [ Si - 1 ]. S;
        S1^. V := M [ Si ]. S;
        S1^. R := #0;
        M [ Si - 1 ]. S := S1;
        Inc ( M [ Si - 1 ]. I, M [ Si ]. I );
        Dec ( Si );
        Sort ( 0, Si );
      End;
  End;

  Procedure Pradzia;
    Var I, J : Word;
        C1 : Char;
        S1 : Sar;
  Begin
    Assign ( Input, Duom_byla );
    Reset ( Input );
    Sim := 0;
    While True Do
      Begin
        Read ( Input, C1 );
        If C1 = #0 Then
          Begin
            Close ( Input );
            Break;
          End;
        Read ( Input, I );
        New ( M [ Sim ]. S );
        M [ Sim ]. I := I;
        Inc ( Simb, I );
        S1 := M [ Sim ]. S;
        S1^. R := #0;
        S1^. V := Nil;
        New ( S1^. N );
        S1 := S1^. N;
        S1^. R := C1;
        S1^. N := Nil; S1^. V := Nil;
        Inc ( Sim );
        Read ( Input, C1 );
      end;
    Dec ( Sim );
    Medis;
  End;

  Function Jei ( CI : Char; II : Byte ): Boolean;
    Var A, B, AA : Byte;
  Begin
    A := Ord ( CI );
    B := 128 Shr ( II - 1 );
    A := B Or A;
    B := Ord ( CI );
    If A = B Then
      Jei := True
    Else
      Jei := False;
  End;

  Procedure Darbas;
    Var C1, C2 : Char;
        I, J, K : Word;
        S1 : Sar;
  Begin
    S := M [ 0 ]. S;
    Assign ( Input, Duom_byla );
    Reset ( Input );
    Assign ( Output, Ats_byla );
    ReWrite ( Output );
    For I := 1 To Sim Do Read ( Input, C1, J, C1 );
    ReadLn ( Input );
    Read ( Input, C1 );
    J := 0; I := 0;
    K := Ord ( C1 );
    Sim := Simb;
    While I <= Sim Do
      Begin
        S1 := S;
        While S1^. R = #0 Do
          Begin
            Inc ( J );
            If Jei ( C1, J ) Then
              S1 := S1^. V
            Else
              S1 := S1^. N;
            If J = 8 Then
              If I = Simb Then
                Begin
                  Close ( Output );
                  Halt;
                end Else Begin
                  Read ( Input, C1 );
                  J := 0;
                  K := Ord ( C1 );
                end;
          End;
        Write ( Output, S1^. R );
        Inc ( I );
      End;
    Close ( Input );
    Close ( Output );
  End;

Begin
  Pradzia;
  Darbas;
End.{$I+,Q+,S+,R+}
{                 Paneve‘io Juozo Bal‡ikonio gimnazijos
                         2t4 klas‚s mokionio
                         Pauliaus Kutkai‡io
                          baigiamojo etapo
                       I u‘davinio sprendimas
                                                                             }
Program IsPakavimas;
 Type Info=Record
       Kiek:Integer;
       Ko:String[150];
       C:Integer;
           End;
  Var Tek:Array[Chr(1)..Chr(255)]Of Info;
      M:Array[1..8]Of 0..128;
      A,B:Text;
      K,I,J,O,T:Integer;
      S:String;
      C,F:Char;
   Function Vertimas(O:Integer):String;
    Var NS:String;
        G:Integer;
     Begin
      NS:='';
       For G:=8 DownTo 1 Do
        If O-M[G]>=0 Then
                     Begin
                      O:=O-M[G];
                      NS:='1'+NS;
                     End
                    Else NS:='0'+NS;
      Vertimas:=NS;
     End;
   Procedure Medzio_Darymas;
    Var Kod:String;
        Ra:Integer;
     Begin
      M[1]:=1;
      M[2]:=2;
      M[3]:=4;
      M[4]:=8;
      M[5]:=16;
      M[6]:=32;
      M[7]:=64;
      M[8]:=128;
      Tek[Chr(1)].Ko:='1';
      Tek[Chr(2)].Ko:='10';
      Kod:='1';
      I:=2;
       While Tek[Chr(I)].Kiek<>0 Do
        Begin
         If Tek[Chr(I)].Ko<>''
          Then
           Begin
            Ra:=0;
            J:=I+1;
             While (Tek[Chr(J)].Kiek<>0)And(Ra<>2) Do
              Begin
               If Tek[Chr(J)].Ko='' Then
                Begin
                 Inc(Ra);
                 If Ra=1 Then Tek[Chr(J)].Ko:=Tek[Chr(I)].Ko+'0';
                 If Ra=2 Then Tek[Chr(J)].Ko:=Tek[Chr(I)].Ko+'1';
                End;
              Inc(J);
             End;
           End;
        Inc(I);
       End;
     End;
   Function Trauk:Char;
    Var K:Integer;
        D:String;
     Begin
      For I:=8 DownTo 1 Do
       Begin
        For J:=Length(S) DownTo 1 Do
         Begin
          D:=Copy(S,J,Length(Tek[Chr(I)].Ko));
          If (D=Tek[Chr(I)].Ko)And(D<>'')
           Then
            Begin
             Delete(S,J,Length(D));
             Trauk:=Chr(I);
             Exit;
            End;
         End;
       End;
     End;
   Procedure Atstatymas;
    Var I,J,K:Integer;
        Tar:Info;
     Begin
      For I:=1 To 255 Do
       For J:=1 To 255 Do
        If Tek[Chr(I)].C<>I Then
         Begin
          Tar:=Tek[Chr(I)];
          K:=Tek[Chr(I)].C;
          Tek[Chr(I)]:=Tek[Chr(K)];
          Tek[Chr(K)]:=Tar;
         End;
     End;
   Procedure Rusiuok;
    Var Tar:Info;
        I,J:Integer;
     Begin
      For I:=1 To 254 Do
       For J:=I+1 To 255 Do
        If Tek[Chr(I)].Kiek<Tek[Chr(J)].Kiek
         Then
          Begin
           Tar:=Tek[Chr(I)];
           Tek[Chr(I)]:=Tek[Chr(J)];
           Tek[Chr(J)]:=Tar;
          End;
     End;
Begin
 Assign(A,'Progr.Pak');
 Assign(B,'Progr.Kap');
  Reset(A);
  ReWrite(B);
   For K:=1 To 255 Do
    Begin
     Tek[Chr(K)].Kiek:=0;
     Tek[Chr(K)].Ko:='';
     Tek[Chr(K)].C:=K;
    End;
  K:=254;
   While Not EOLn(A)Do
    Begin
     Read(A,C);
     Tek[C].Kiek:=K;
     Dec(K);
    End;
  ReadLn(A);
  Rusiuok;
  Medzio_Darymas;
  Atstatymas;
  S:='';
  While Not EOF(A) Do
   Begin
    F:='p';
    While F<>'&'Do
     Begin
      Read(A,F);
      If F<>'&'Then
       Begin
        S:=S+Vertimas(Ord(F));
        Rusiuok;
        If Length(S)>245 Then Write(B,Trauk);
        Atstatymas;
      End;
     End;
     ReadLn(A,O);
     For T:=1 To O Do
      Delete(S,Length(S),1);
     Rusiuok;
    While S>'' DO
     Write(B,Trauk);
     Atstatymas;
    Writeln(B);
   End;
   Close(B);
 Close(A);
End.
{ Gedimino LukÕio, KTU Gimnazija, 4c, 1 uØd. }
{ IdÓja: pakuoti pagal didelÔ baziniÖ ØodØiÖ, proced×rÖ ir t.t. rinkinÔ,
  t.p. "apnaikinti" tarpus. Tiesa, yra ir daug kitÖ pakavimo metodÖ,
  bet Õitie pasirodÓ geriausi, o uØdaviniÖ sprendimo laikas kaip beb×tÖ
  ribotas... }

{$A+,B-,D+,E+,F-,G-,I-,L+,N-,O-,P-,Q-,R-,S-,T-,V+,X+}
{$M 16384,0,655360}
const CDazn : array [34..208] of string =
  ('ABS', 'ARRAY', 'ASM', 'ASSIGN', 'APPEND', 'ARCTAN', 'BEGIN',
   'BLOCK', 'BOOLEAN', 'BYTE', 'BREAK', 'UPCASE', 'CASE', 'CONCAT',
   'CHAR', 'CHDIR', 'CONSTRUCTOR', 'CONTINUE', 'COPY', 'CHR',
   'COS', 'CREATEDIR', 'CRT', 'CLOSE', 'CLRSCR', 'CLREOL', 'DEC', 'DELAY',
   'DELETE', 'DOSEXITCODE', 'DOS', 'ERROR', 'DESTRUCTOR', 'DOWNTO',
   'DISPOSE', 'DIV', 'EXEC', 'ELSE', 'EXIT', 'EXP', 'END', 'EOF',
   'EOLN', 'ERASE', 'FILE', 'FORWARD', 'FRAC', 'FREE', 'FILL',
   'FIND', 'FUNCTION', 'FLAG', 'FLUSH', 'GET', 'COLOR', 'DATE', 'TIME',
   'IMAGE', 'GOTO', 'GRAPH', 'HALT', 'HEAP', 'IMPLEMENTATION', 'INIT',
   'INC', 'INDEX', 'INHERITED', 'INLINE', 'INPUT', 'INSERT', 'INTEGER',
   'SHORTINT', 'INTERFACE', 'INTERRUPT', 'IORESULT', 'KEEP', 'KEYPRESSED',
   'LABEL', 'LOAD', 'LENGTH', 'LIBRARY', 'LIMIT', 'LINE', 'LONGINT', 'LOW',
   'MESSAGE', 'MIN', 'MAX', 'MARK', 'MOD', 'MKDIR', 'MEM', 'NEW',
   'NEXT', 'NIL', 'FALSE', 'TRUE', 'NORMAL', 'ITEM', 'NOT', 'NUMBER',
   'OBJECT', 'ODD', 'OUTPUT', 'PACK', 'PALETTE', 'PARAM', 'PRED',
   'PREV', 'PROCEDURE', 'PROGRAM', 'PUT', 'POS', 'RANDOM', 'RELEASE',
   'READLN', 'READ', 'REMOVE', 'RENAME', 'REPEAT', 'RECORD', 'RESET', 'XOR',
   'REWRITE', 'RMDIR', 'ROUND', 'SHOW', 'SHR', 'SIN', 'SIZE', 'SAVE',
   'SOUND', 'SQR', 'SEARCH', 'SEEK', 'SET', 'STRING', 'STR', 'SUCC', 'SWAP',
   'SHL', 'TRUNC', 'TEXT', 'THEN', 'TYPE', 'UNIT', 'USES', 'UNTIL', 'VAL',
   'VAR', 'VIRTUAL', 'WHILE', 'WHERE', 'WRITELN', 'WINDOW',
   'POINTER', 'OUT', 'AND', 'CONST', 'FOR', 'ORD', 'WRITE', 'WIN', 'RUN',
   'MOVE', 'PROG', 'EIL', 'DAT', 'TXT', 'DUOM', 'HIDE', 'PAV', 'RASTI',
   'SPAUSD', 'IVESTI');


var inf, outf : text;
    s : string;
    i : integer;
    cc : char;

procedure DePack (var eil: string);

  var tps, len : byte;
      i : integer;
      Changed : boolean;

  begin
    tps := 1;
    while tps <= length(eil) do
      begin
        if eil[tps] = chr(255) then
          begin
            if eil[tps+1] <> chr(33) then
              begin
                len := ord(eil[tps+1]) - 31;
                delete (eil, tps, 2);
                for i := 1 to len do
                  insert (' ', eil, tps);
              end;
            if eil[tps+1] = chr(33) then
                delete (eil, tps+1, 1);
          end;
        if eil[tps] = chr(254) then
          begin
            if eil[tps+1] <> chr(33) then
              begin
                i := ord(eil[tps+1]);
                delete (eil, tps, 2);
                insert (CDazn[i], eil, tps);
              end;
            if eil[tps+1] = chr(33) then
                delete (eil, tps+1, 1);
          end;
        inc(tps);
      end;
  end;

begin
  Assign (inf, 'progr.pak');
  Assign (outf, 'progr.kap');
  Reset (inf);
  Rewrite (outf);
  while not eof(inf) do
    begin
      s := '';
      while not eoln(inf) do
      begin
        Read (inf, cc);
        s := s + cc;
      end;
      DePack (s);
      if not eof(inf) then
        begin
          WriteLn (outf, s);
          ReadLn (inf);
        end
      else Write (outf, s);
    end;
  close (inf);
  close (outf);
end.
{
  Vidmantas Maskoli×nas (mailto:vmm@operamail.com)
  MarijampolÓs 6-oji vidurinÓ mokykla, 10 klasÓ
  UØdavinys nr. 1 (Paskalio programÖ pakavimas)
}

{$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,P-,Q+,R+,S+,T-,V+,X+}
program depack;
var t, tt: text;
    s: string;

procedure update(var s: string);
const ilgis = 242;
      c: array [128..ilgis] of string =
{#127+byte -- spaces}
(
'implementation',
'blockwrite(',
'blockwrite',
'blockread(',
'procedure ',
'procedure',
'blockread',
'interface',
'function ',
'function',
'shortint',
'writeln(',
'writeln;',
'dispose(',
'rewrite(',
'program ',
'program',
'longint',
'pointer',
'integer',
'pointer',
'string[',
'string ',
'assign(',
'concat(',
'insert(',
'delete(',
'length(',
'readln(',
'assign',
'concat',
'insert',
'delete',
'length',
'readln',
'repeat',
'string',
'record',
'single',
'double',
'downto',
'reset(',
'write(',
'close(',
'readln',
'reset',
'write',
'close',
'begin',
'while',
'uses ',
'unit ',
'array',
'until',
'const',
'read(',
'real',
'read',
'uses',
'byte',
'then',
'else',
'type',
'text',
'file',
'real',
'unit',
'ord(',
'chr(',
' := ',
'pos(',
'inc(',
'dec(',
'eof(',
'end.',
' < ',
' > ',
' = ',
'ord',
'chr',
'pos',
'inc',
'dec',
'var',
'shl',
'end',
'shr',
'and',
'new',
'xor',
'eof',
'not',
'for',
'do',
'to',
'if',
'<>',
'>=',
'<=',
':=',
'or',
'of',
'in',
''')',
'an',
''',',
' : ',
': ',
');',
', ',
' [',
'] ',
'];',
'(''',
'..'

);
var b, bb, ch: byte;
begin
  b := 0;
  while b < length(s) do begin
    inc(b);
    ch := ord(s[b]);
    if ch = 127 then begin
      ch := ord(s[b+1]);
      delete(s, b, 2);
      for bb := 1 to ch do insert(' ', s, b);
    end else
    if ch in [128..ilgis] then begin
      delete(s, b, 1);
      insert(c[ch], s, b)
    end
  end;
end;

begin
  assign(t, 'PROGR.PAK');
  reset(t);
  assign(tt, 'PROGR.KAP');
  rewrite(tt);

  while not eof(t) do begin
    readln(t, s);
    update(s);
    writeln(tt, s)
  end;

  close(tt);
  close(t)
end.{Ignas Mikalajûnas KTU Gimnazija
       3b Klasó
     Uýdavinys Nr 1 
     I÷pakuotojas
}
{$A+,B-,D+,E+,F+,G-,I+,L+,N-,O-,P-,Q+,R+,S+,T-,V+,X+}
{$M 65520,0,655360}
var c:char;
    dat,rez:text;
    pab,pak:boolean;
begin
assign(dat,'progr.pak');
assign(rez,'progr.kap');
reset(dat);
rewrite(rez);
while not(eof(dat)) do
begin
read(dat,c);
case c of
     'q':write(rez,');'+chr(13));
     'w':write(rez,'WHILE');
     'e':write(rez,'END');
     'r':write(rez,'WRITE');
     't':write(rez,' := ');
     'y':write(rez,' + ');
     'u':write(rez,' - ');
     'i':write(rez,'IF');
     'o':write(rez,' / ');
     'p':write(rez,'PROCE');
     'a':write(rez,'VAR');
     's':write(rez,'ASM');
     'd':write(rez,'DO');
     'f':write(rez,'FOR');
     'g':write(rez,' * ');
     'h':write(rez,'THEN');
     'j':write(rez,'WORD');
     'k':write(rez,'NOT');
     'l':write(rez,'ELSE');
     'z':write(rez,'TRUE');
     'x':write(rez,'FALSE');
     'c':write(rez,'CASE');
     'v':write(rez,'READ');
     'b':write(rez,'BEGIN');
     'n':write(rez,'IN');
     'm':write(rez,'FUNCT');
    else write(rez,c);
  end;
end;
close(rez);
end.{$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,P-,Q-,R-,S+,T-,V+,X+}
{$M 16384,0,655360}


{ Jurgis Pažukonis }
{   VTGTM lic‚jus  }
{     11 klas‚     }
{    1 u‘davinys   }



const kitas = 255;
      tarpas = 254;

      kzodz = 122;
      maxzodz = 253;
      maxlength = 40;
      konst_zodziai : array [1 .. kzodz] of string[maxlength] =
                  ('program', 'unit', 'interface', 'implementation',
                   'uses', 'label', 'const', 'type',
                   'var', 'procedure', 'function', 'begin', 'end',
                   'array', 'of', 'string', 'record', 'integer', 'longint', 'real', 'boolean',
                   'text', 'char',
                   'assign', 'reset', 'rewrite', 'append', 'close',
                   'write', 'read', 'writeln', 'readln', 'for', 'to', 'do', 'while', 'repeat', 'until',
                   'if', 'then', 'else', 'and', 'or', 'not', 'xor',
                   'true', 'false', 'div', 'mod', 'dec', 'inc', 'chr','ord', 'length',
                   'copy', 'delete', 'insert',
                   'fillchar', 'getmem', 'freemem', 'move',

                   ':=', chr(13)+chr(10),
                   ' ',
                   'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
                   'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
                   '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
                   chr(39), '(', ')', '+', '-', '*', '/', '[', ']', '{', '}',',', '.', ';', ':',
                   '#', '$', '@', '^','=', '<', '>');

  var fi : file of byte;
      fo : file of char;

      ck, c, kz : integer;
      a : byte;
      ch : char;
      zodziai : array [1 .. maxzodz] of string[maxlength];

begin
  assign (fi, 'progr.pak'); reset (fi);
  assign (fo, 'progr.kap'); rewrite (fo);

  for ck := 1 to kzodz do
    zodziai[ck] := konst_zodziai[ck];
  read (fi, a);
  kz := kzodz + a;
  for ck := kzodz+1 to kz do
    begin
      read (fi, a);
      zodziai[ck,0] := chr(a);
      for c := 1 to length(zodziai[ck]) do
        begin
          read (fi, a);
          zodziai[ck,c] := chr(a)
        end;
    end;

  while not eof(fi) do
  begin
    read (fi, a);
    if a = tarpas then
      begin
        read (fi, a);
        ch := ' ';
        for c := 1 to a do write (fo, ch);
        continue;
      end;
    if a = kitas then
      begin
        read (fi, a);
        ch := char (a);
        write (fo, ch);
        continue;
      end;

    for c := 1 to length(zodziai[a]) do
      write (fo, zodziai[a,c]);
  end;

end.{andrius paukžt‚                  }
{žven‡ioni— 2-oji vid. mokykla    }
{12 a klas‚                       }
{žven‡ioni— raj.                  }
{pirmas u‘davinys                 }
program pak;
 const res = [1..9,11..12,14..31,65..90];
 var fr :text;
     f :file of byte;
     a :byte;
     t :char;

 procedure isp(a :byte);
  var st :string;
 begin
   if a=1 then st:='program ' else
   if a=12 then st:='char;' else
   if a=14 then st:='boolean;' else
   if a=15 then st:='text;' else
   if a=24 then st:='var ' else
   if a=8 then st:='integer;' else
   if a=2 then st:='begin' else
   if a=28 then st:='maxlongint' else
   if a=4 then st:='while ' else
   if a=2 then st:='begin' else
   if a=11 then st:='longint' else
   if a=3 then st:='end';
   write(fr,st);
   if st='end' then if eof(f) then write(fr,'.')
                              else write(fr,';');
 end;

begin
  assign(f,'progr.pak'); reset(f);
  assign(fr,'progr.kap'); rewrite(fr);
  while not eof(f) do
   begin
     read(f,a);
     if (a = 10)or(a=13) then writeln(fr)
      else
     if a in res then isp(a)
      else begin
             t:=chr(a);
             write(fr,t);
           end;

   end;

  close(fr); close(f);
end.{                           Saulius Petrauskas
                       Klaip‚dos ‘uolyno gimnazija
                               10 c klas‚
                                 u‘d. 1                                      }

{ Ÿ u‘davin sprend‘iau naudodamasis Lempel-ZIW duomen— suglaudinimo
  algoritmu. Jis yra vienas populiariausi—. Duomenys ižpakuojami taip:
  skaitome simbol, jeigu tas simbolis rodo indeks… tada ‘odyne
  pa‘i–rime jo reikžmŠ ir j… u‘ražome  rezultat…. Kitu atveju
  t… simbol ižkart ražome  rezultat…, ir j vedame  ‘odyn…               }

{$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,P-,Q+,R-,S+,T-,V+,X+}
{$M 65000,0,655360}
program ispakavimas;
  type
     duom = record
               dat: array[0..64999] of byte; { 65 kb masyvas }
               posb, post: word;
             end;
      duom_p = ^duom;    { duomenys atmintyje }
  const maxz = 1024 - 1;  { ‘odyno dydis }
        maxs = 70;      { eilut‚s dydis }

  var   dkiek: word;     { duomen— kiekis }
        rez: text;       { rezultat— byla }
        dic: array[256..maxz] of string[maxs];   { ‘odynas }

Procedure Atspausk( inbuf: duom_p );
{ Atspaud‘ia suspaustus duomenis }
  var code, old, d, jp: word;
                kelbit: byte;
                     s: string[maxs];

  Procedure ReadBit( var x: word; kbit: word );
  { perskaito kbit bit— iž masyvo  x }
    var i: byte;
  begin
    x := 0;
    with inbuf^ do
      for i := 1 to kbit do
      begin
        x := x + dat[post] shr posb and 1 shl (kbit - i);
        posb := posb + 1;
        if posb = 8 then begin post := post + 1; posb := 0 end;
      end;
  end;

  Function GetDic( c, k: word ): string;
  { ižveda ‘odyno eilutŠ }
  begin
    if c < 256 then
    begin
      getdic := Chr( c );
      Exit
    end;
    if k = 1 then getdic := dic [c][1] else getdic := dic [c];
  end;

  Procedure EndDic;
  { ižvalo ‘odyn… }
  begin
    FillChar(dic,sizeof(dic),#0);
    d := 256;
  end;

begin
  EndDic;        { Ižvalome ‘odyn… }
  kelbit := 10;   { ražysime 9 bitais }
  inbuf^.posb := 0;
  inbuf^.post := 0;
  code := 0;
  readbit(code, kelbit);   { skaitome duomenis }
  s := getdic( code, 0);
  write(rez, s);  { ražome duomenis }
  old := code;
  repeat
    readbit(code, kelbit);
    if Code < D then
    begin
      s := getdic( code, 0);
      write(rez,s);
      dic[d] := getdic( old, 0) + getdic( code,1 );
      old := Code;
      d := d + 1; if d > maxz - 1 then EndDic; { jei baig‚si ‘odynas }
    end
    else
    begin
      s := getdic( old,0 ) + getdic( old,1 );
      write(rez,s);
      dic[d] := s; old := code;
      d := d + 1; if d > maxz - 1 then EndDic; { jei baig‚si ‘odynas }
    end;
    { nustatome kiek duomen— jau perskait‚me }
    if inbuf^.posb > 0 then jp:=inbuf^.post + 1 else jp := inbuf^.post;
  until jp >= dkiek;
end;

var prad: file;      { pradini— duomen— byla }
    duomin: duom_p;  { duomenys }

begin
  { atveriame pradini— duomen— byl… }
  Assign( prad, 'progr.pak');
  Reset( prad, 1 );
  { atveriame rezultat— byl… }
  Assign( rez,  'progr.kap');
  Rewrite( rez );
  { rezervuojame atmint duomenims }
  new (duomin);
  { skaitome ir atspaud‘iame duomenis }
  BlockRead( prad, duomin^.dat, 65000, dkiek);
  Atspausk( duomin );
  { atlaisviname rezervuot… atmint }
  dispose(duomin);
  { u‘veriame bylas }
  close( prad );
  close( rez );
end.
{I+,Q+,R+,S+}
{$M 16384,0,655360}
                                                                                {
                   Panev‚‘io J. Bal‡ikonio gimnazijos
                   3t4 klas‚s mokinio
                   Domanto Rasalskio
                   informatikos olimpiados
                   baigiamosios dalies
                   pirmojo u‘davinio sprendimas
                   "IŸPAKAVIMAS"

                   Id‚jos apražymas
            Naudoju Hufmano ižpakavimo algoritm… (buvo apražytas
     "Kompiuterijoje").
                                                                                }
program hufmanas;
  type med = ^medis;
       medis = record
         r : string [ 1 ];
         a, n, v : med;
       end;
       simbol = record
         c : char;
         i : word;
       end;
       lauk = ^laukas;
       laukas = record
         s : word;
         n : lauk;
         m : med;
       end;
       tip = 0 .. maxlongint;
       simbo = array [ 1 .. 255 ] of simbol;
  var c, c1 : char;
      m : med;
      b, b1 : text;
      Db, ib : string;
      s, s1 : simbo;
      l : lauk;
      mak : pointer;
      im : array [ 0 .. 255 ] of string [ 100 ];
      kod : string;
  procedure Quicksort( lo,hi: integer);
    procedure sort(l,r: integer);
      var i, j, x : integer;
          y : simbol;
    begin
      i := l;
      j := r;
      x := s [ ( l + r ) Div 2 ]. i;
      repeat
        while s [ i ]. i < x do i := i + 1;
          while x < s [ j ]. i do j := j - 1;
            if i <= j then
              begin
                y := s [ i ];
                s [ i ] := s [ j ];
                s [ j ] := y;
                i := i + 1;
                j := j - 1;
              end;
      until i > j;
      if l < j then sort ( l, j );
      if i < r then sort ( i, r );
  end;
  begin
    sort ( lo, hi );
  end;
  function pat ( e : string; k : word ) : boolean;
    var a, i : byte;
  begin
    a := ord ( e [ ( ( k - 1 ) Div 8 ) + 1 ] );
    i := ( k - 1 ) mod 8 + 1;
    a := ( a shr ( 8 - i ) ) shl 7;
    if a > 0 then
      pat := true
    else
      pat := false;
  end;
  function idek ( e : string; k : word; l : boolean ) : string;
    var l1 : boolean;
        i, j, a, b : byte;
        c1 : char;
        e1 : string;
  begin
    e1 := e;
    while length ( e1 ) * 8 < k Do
      e1 := e1 + char ( 0 );
    l1 := pat ( e1, k );
    if l1 = l then
      begin
        idek := e1;
        exit;
      end;
    c1 := e1 [ ( ( k - 1 ) Div 8 ) + 1 ];
    a := ord ( c1 );
    i := ( k - 1 ) mod 8 + 1;
    if not l then
      a := not a;
    b := 128 shr ( i - 1 );
    a := a or b;
    if not l then
      a := not a;
    e1 [ ( ( k - 1 ) Div 8 ) + 1 ] := char ( a );
    idek := e1;
  end;
  procedure smedip;
    var l1, l2, l3 : lauk;
        m1 : med;
        i : tip;
  begin
    l1 := l;
    while l^. n <> nil Do
      begin
        i := l^. s + l^. n^. s;
        new ( m1 );
        m1^. a := nil;
        m1^. n := l^. m;
        m1^. v := l^. n^. m;
        l^. m^. a := m1;
        l^. n^. m^. a := m1;
        m1^. r := '';
        l1 := l^. n^. n;
        Dispose ( l^. n );
        Dispose ( l );
        l := l1;
        new ( l2 );
        l2^. s := i;
        l2^. m := m1;
        if ( l^. s > l2^. s ) or ( l = nil ) then
          begin
            l2^. n := l;
            l := l2;
          end else begin
            l1 := l;
            while l1^. n <> nil Do
              begin
                if l1^. n^. s > l2^. s then
                  break;
                l1 := l1^. n;
              end;
            l2^. n := l1^. n;
            l1^. n := l2;
          end;
      end;
    m := l^. m;
  end;
  procedure isskleisk_medi;
    var i : byte;
        gl : boolean;
        e : string;
        m1, m2 : med;
        c2 : char;
    label atgal;
  begin
    kod := '';
    for i := 0 to 255 Do im [ i ] := '';
    gl := true;
    e := '';
    m1 := m;
    while gl Do
      begin
        if m1^. r <> '' then
          begin
            im [ ord ( m1^. r [ 1 ] ) ] := e;
            kod := kod + m1^. r;
            goto atgal;
          end;
        if m1^. n <> nil then
          begin
            m1 := m1^. n;
            e := e + '0';
            continue;
          end;
        if m1^. v <> nil then
          begin
            m1 := m1^. v;
            e := e + '1';
            continue;
          end;
        atgal:
        if m1^. a <> nil then
          begin
            c2 := e [ length ( e ) ];
            Delete ( e, length ( e ), 1 );
            m2 := m1;
            m1 := m1^. a;
            case c2 of
              '0' : begin
                      if m1^. n <> nil then
                        Dispose ( m1^. n );
                      m1^. n := nil;
                    end;
              '1' : begin
                      if m1^. v <> nil then
                        Dispose ( m1^. v );
                      m1^. v := nil;
                    end;
            end;
          end else
            gl := false;
      end;
  end;
  procedure pakuos;
    var i, j, a, k : word;
        e1, e2, e3 : string;
        gl : boolean;
        l1 : lauk;
  begin
    assign ( b1, 'progr.pak' );
    assign ( b, 'progr.pas' );
    reset ( b );
    for i := 1 to 255 Do
      begin
        s [ i ]. c := chr ( i );
        s [ i ]. i := 0;
      end;
    while not eof ( b ) Do
      begin
        read ( b, c );
        inc ( s [ ord ( c ) ]. i );
      end;
    s1 := s;
    close ( b );
    Quicksort ( 1, 255 );
    e1 := '';
    new ( l );
    l1 := l;
    for i := 1 to 255 Do
      if s [ i ]. i <> 0 then
        begin
          new ( l1^. n );
          l1 := l1^. n;
          e1 := e1 + s [ i ]. c;
          l1^. s := s [ i ]. i;
          new ( l1^. m );
          with l1^. m^ Do
            begin
              n := nil;
              v := nil;
              a := nil;
              r := s[ i ]. c;
            end;
        end else
          c := s [ i ]. c;
    l1^. n := nil;
    l^. s := 1;
    new ( l^. m );
    with l^. m^ Do
      begin
        a := nil;
        n := nil;
        v := nil;
        r := c;
      end;
    e1 := c + e1;
    e3 := e1;
    rewrite ( b1 );
    l1 := l;
    writeln ( b1,length ( e1 ) );
    while l1 <> nil Do
      begin
        write ( b1, l1^. m^. r, l1^. s, ' ' );
        l1 := l1^. n;
      end;
    writeln( b1 );
    smedip;
    isskleisk_medi;
    reset ( b );
    inc ( s1 [ ord ( c ) ]. i );
    read ( b, c1 );
    a := 1;
    gl := true;
    e2 := '';
    while true Do
      begin
        for j := 1 to length ( im [ ord ( c1 ) ] ) Do
          begin
            k := ord ( c1 );
             if im [ k ] [ j ] = '1' then
              e2 := idek ( e2, a, true )
            else
              e2 := idek ( e2, a, false );
            if a = 8 then
              begin
                write ( b1, e2 [ 1 ] );
                e2 := '';
                a := 0;
              end;
            inc ( a );
          end;
        if c1 = c then
          break;
        if not eof ( b ) then
          read ( b, c1 )
        else
          c1 := c;
      end;
    if e2 [ 1 ] <> '' then
      write ( b1,e2 [ 1 ] );
    close ( b );
    close ( b1 );
  end;
  procedure ispakuoti;
    var i, j, Z : word;
        e, e1, e2 : string;
        m1 : med;
        c : char;
        log1 : boolean;
        l1 : lauk;
  begin
    assign ( b, 'progr.pak' );
    assign ( b1, 'progr.kap' );
    reset ( b );
    e1 := '';
    new ( l );
    l1 := l;
    readln ( b, j );
    for Z := 1 to j Do
      begin
        read ( b, c, i );
        e1 := e1 + c;
        new ( l1^. n );
        l1 := l1^. n;
        l1^. s := i;
        new ( l1^. m );
        with l1^. m^ Do
          begin
            n := nil;
            v := nil;
            a := nil;
            r := c;
          end;
        read ( b, c );
      end;
    readln ( b );
    l1^. n := nil;
    l1 := l^. n;
    Dispose ( l );
    l := l1;
    c := l^. m^. r [ 1 ];
    smedip;
    i := 1;
    read ( b, c1 );
    rewrite ( b1 );
    while m1^.r <> c Do
      begin
        m1 := m;
        while m1^. r = '' Do
          begin
            log1 := pat ( c1, i );
            if log1 then
              m1 := m1^. v
            else
              m1 := m1^. n;
            if i = 8 then
              begin
                i := 0;
                read ( b, c1 );
              end;
            inc ( i );
          end;
        if m1^. r <> c then
          write ( b1, m1^. r )
        else break;
      end;
    close ( b1 );
    close ( b );
  end;
begin
  ispakuoti;
end.
{$I+,Q+,R+,S+}
{$M 16384,0,655360}
                                                                                                {
                 Panev‚‘io J. Bal‡ikonio gimnazijos
                       2T4 klas‚s mokinio
                         Justo Samuolio
                   I u‘davinio sprendimas (ižpakavimas);
                                                                                                }
Program Paskalio_programu_pakavimas;

    Const DuomByla = 'progr.pak';
          RezByla = 'progr.kap';
          N = 80;
          M : Array [ 1 .. N ] Of String =
                    ( 'CONST ', 'END.', 'END;', 'VAR ','USES','WRITELN',
                      ' THEN ',
                      'READ', 'CLOSE', 'TEXT', 'WORD', 'REAL', 'SINGLE',
                      'DOUBLE', 'BEGIN', 'BYTE', 'ARRAY',
                      'PROGRAM ', 'PROCEDURE ', 'FUNCTION ', 'INTEGER', 'BOOLEAN',
                      'LONGINT', 'SHORTINT', 'MAXINT', 'MAXLONGINT', 'STRING',
                      'WRITE', 'READLN', 'BLOCKREAD', 'BLOCKWRITE', 'IMPLEMENTATION',
                      'CONSTUCTOR', 'INITGRAPH', 'CLOSEGRAPH', 'DELETE', 'INSERT',
                      'CLEARDEVICE;', 'ASSEMBLER', 'RANDOM', 'RANDOMIZE;', 'ASSIGN',
                      'REWRITE', 'ABSOLUTE ', 'INTERFACE', 'GETTIME', 'GETDATE',
                      'GETMAXX','GETMAXY', 'CIRCLE', 'FILLPOLY', 'FILLELLIPSE', 'ELLIPSE',
                      'CONTINUE', 'DETECT;', 'SWAPVECTORS;', 'LENGTH', 'CONCAT',
                      'FILLCHAR', 'DRAWPOLY', 'SETCOLOR', 'SETTEXTSTYLE', 'SETTEXTJUSTIFY',
                      'GETMOUSEVENT', 'FORWARD', 'TEXTBACKGROUND', 'TEXTCOLOR',
                      'KEYPRESSED', 'DISPOSE', 'NOSOUND', 'POINTER', 'READKEY',
                      'SETFILLSTYLE', 'MAXLINELENGTH', 'SETBGCOLOR', 'WINDOW',
                      '{$M 16384,0,655360}', '{$I+,Q+,R+,S+}', 'UPCASE',
                       '{$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,P-,Q+,R+,S+,T-,V+,X+}'
                       );

 Procedure Apdoroti ( Eil : String; Var Ne : String );
  Var I, J, P : Integer;
      Simb  : String;
  Label Tol;
 Begin
   For I := 2 To 255 Do
    Begin
     Str ( I, Simb );
     Simb := ')' + Simb + '(';
     P := Pos ( Simb, Eil );
     If P = 1 Then
      Begin
       Delete ( Eil, 1, Length ( Simb ) );
       J := I;
       While J > 0 Do
        Begin
         Dec ( J );
         Insert ( ' ', Eil, 1 );
        End;
       Break;
      End;
    End;
   Tol:
   For I := 1 To N Do
    Begin
      Str ( I, Simb );
     Simb := '^' + Simb + '&';
     P := Pos ( Simb, Eil );
     If P <> 0 Then
      Begin
       Delete ( Eil, P, Length ( Simb ) );
       Insert ( M [ I ], Eil, P );
      End;
    End;
    Ne := Eil;
 End;

 Procedure Ispakuoti;
  Var I, J : Integer;
      Eil : String;
      B1, B2 : Text;
 Begin
   Assign ( B1, DuomByla );
   Reset ( B1 );
   Assign ( B2, RezByla );
   ReWrite ( B2 );
   While Not Eof ( B1 ) Do
    Begin
     ReadLn ( B1, Eil );
     Apdoroti ( Eil, Eil );
     If EOF ( B1 ) Then Write ( B2, Eil )
                   Else WriteLn ( B2, Eil );
    End;
   Close ( B1 );
   Close ( B2 );
 End;

BEGIN
   IsPakuoti;
END.