unit tools;

interface

uses
  SysUtils;

const MAX = 100;

type
  int = longint;

var
  a: array[1..MAX] of string;
  n: int = 0;

procedure add(s: string);
procedure addn(s: int);
procedure shuffle;
procedure done;

implementation

procedure checkn;
begin
  if (n > MAX) then
  begin
    writeln('ERROR: TOO MANY STRINGS');
    halt(1);
  end;
end;

procedure add(s: string);
begin
  inc(n);
  checkn;
  a[n] := s;
end;

procedure addn(s: int);
begin
  inc(n);
  checkn;
  a[n] := inttostr(s);
end;

procedure shuffle;
var
  i, j: int;
  s: string;
begin
  for i := 2 to n do
  begin
    j := random(i) + 1;
    s := a[i];
    a[i] := a[j];
    a[j] := s;
  end;
end;

procedure done;
var
  i: int;
begin
  for i := 1 to n do
  begin
    writeln(a[i]);
  end;
end;

end.