uses
	math;

label
	restart;

var
	i, j, u, l: longint;
	s: array [1..26] of string;
	txt, enc: string;
	n: longint;
	ok: boolean;
	retries: longint;
	f, m: longint;

begin
	randseed := 1038838;

	n := 1000;
	f := 10;
	m := 10;

	restart:
	for i := 1 to f do begin
		retries := 0;
		repeat
    		inc(retries);
    		l := random(m) + 1;
    		s[i] := '';
    		for j := 1 to l do begin
    			s[i] := s[i] + char(ord('0') + random(2));
    		end;

    		ok := true;
    		for j := 1 to i - 1 do begin
    			u := min(length(s[i]), length(s[j]));
    			if (copy(s[i], 1, u) = copy(s[j], 1, u)) then begin
    				ok := false;
    				break;
    			end;
    		end;
    	until ok or (retries > 100000);
    	if not ok then goto restart;
	end;

	txt := '';
	for i := 1 to n do begin
		txt := txt + 'abcdefghijklmnopqrstuvwxyz'[random(f) + 1];
	end;

	enc := '';
	for j := 1 to n do begin
		enc := enc + s[ord(txt[j]) - ord('a') + 1];
	end;

	writeln(txt);
	writeln(enc);
end.