program pil_15_32_h(input1,output1);
type
	txt = file of char;
var
	inp : txt;

procedure firsts(var f : txt);
var
	temp : txt;
	cur : char;
	used : set of char;
begin
	reset(f);
	assign(temp, 'output1');
	rewrite(temp);
	used := [];
	while not eof(f) do begin
		read(f, cur);
		if not (cur in used) then begin
			used := used + [cur];
			write(temp, cur);
		end;
	end;
	reset(temp);
	rewrite(f);
	while not eof(temp) do begin
		read(temp, cur);
		write(f, cur);
	end;
	close(temp);
end;

begin
	assign(inp, 'input1');
	firsts(inp);
	close (inp);
end.