program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
const smax=99;
type large=array[0..99] of LongInt;
var data, sort:large; n, i, counter:smallint;
procedure swap(Var a, b:LongInt);
var t:LongInt;
begin
t:=a;
a:=b;
b:=t;
end;
procedure writeArr(arr:large; n:SmallInt);
Var i:smallint;
begin
for i:=0 to n-1 do write(arr[i], ' ');
Writeln;
end;
function difNums(arr:large):large;
Var tArr:large; i, j:SmallInt; isSame:Boolean;
begin
counter := 0;
for i:=0 to n do begin
isSame:=False;
for j:=0 to counter-1 do begin
if arr[i]=tArr[j] then begin
isSame:=True;
end;
end;
if isSame = False then begin
counter := counter + 1;
tArr[counter-1] := arr[i];
end;
end;
difNums := tArr;
end;
procedure bubbleSort(Var arr:large; n:smallint);
Var i, j:smallint;
begin
for i:=0 to n do begin
for j:=i to n do begin
if arr[i]>arr[j] then swap(arr[i], arr[j]);
end;
end;
end;
begin
read(n);
n:=n-1;
for i:=0 to n do read(data[i]);
sort:=difNums(data);
bubbleSort(sort, counter-1);
Writeln(counter);
writeArr(sort, counter);
end.
cHJvZ3JhbSBQcm9qZWN0MTsKCnskQVBQVFlQRSBDT05TT0xFfQoKdXNlcwogIFN5c1V0aWxzOwoKY29uc3Qgc21heD05OTsKdHlwZSBsYXJnZT1hcnJheVswLi45OV0gb2YgTG9uZ0ludDsKdmFyIGRhdGEsIHNvcnQ6bGFyZ2U7IG4sIGksIGNvdW50ZXI6c21hbGxpbnQ7Cgpwcm9jZWR1cmUgc3dhcChWYXIgYSwgYjpMb25nSW50KTsKdmFyIHQ6TG9uZ0ludDsKYmVnaW4KICB0Oj1hOwogIGE6PWI7CiAgYjo9dDsKZW5kOwoKcHJvY2VkdXJlIHdyaXRlQXJyKGFycjpsYXJnZTsgbjpTbWFsbEludCk7ClZhciBpOnNtYWxsaW50OwpiZWdpbgogIGZvciBpOj0wIHRvIG4tMSBkbyB3cml0ZShhcnJbaV0sICcgJyk7CiAgV3JpdGVsbjsKZW5kOwoKZnVuY3Rpb24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