Program VerySimpleProblem;

Const MaxN=200000;

Type TData = Record
               ndata: LongInt;    // given item
               norder: LongInt;   // its position
             End;
     List = array [1..MaxN] of TData;

procedure QuickSort1(var A: List; Lo, Hi: LongInt);
      procedure Sort(l, r: LongInt);
      var i, j: LongInt;
          x, y: TData;
      begin
        i := l; j := r; x := a[(l+r) DIV 2];
        repeat
          while (a[i].ndata < x.ndata) or
                ((a[i].ndata = x.ndata) and (a[i].norder < x.norder)) do Inc(i);
          while (x.ndata < a[j].ndata) or
                ((x.ndata = a[j].ndata) and (x.norder < a[j].norder)) do Dec(j);
          if i <= j then begin
            y := a[i]; a[i] := a[j]; a[j] := y;
            Inc(i); Dec(j);
          end;
        until i > j;
        if l < j then Sort(l, j);
        if i < r then Sort(i, r);
      end;
begin {QuickSort};
  Sort(Lo,Hi);
end;

procedure QuickSort2(var A: List; Lo, Hi: LongInt);
      procedure Sort(l, r: LongInt);
      var i, j: LongInt;
          x, y: TData;
      begin
        i := l; j := r; x := a[(l+r) DIV 2];
        repeat
          while a[i].norder < x.norder do Inc(i);
          while x.norder < a[j].norder do Dec(j);
          if i <= j then begin
            y := a[i]; a[i] := a[j]; a[j] := y;
            Inc(i); Dec(j);
          end;
        until i > j;
        if l < j then Sort(l, j);
        if i < r then Sort(i, r);
      end;
begin {QuickSort};
  Sort(Lo,Hi);
end;


Var f: Text;
    n: LongInt;  // items amount
    a: List; // data array
    i, j: LongInt;
Begin
  n:= 0;
  {Read datum}
//  Assign(f, 'simple.in'); Reset(f);
  While not EoF Do Begin
    Inc(n);
    Readln(a[n].ndata);
    a[n].norder:= n;
  End;
//  Close(f);
  {First sorting (by data then by index)}
  QuickSort1(a,1,n);
  {Purge}
  j:= 1;
  For i:= 2 To n Do Begin
    If a[i].ndata<>a[j].ndata Then Begin
      Inc(j);
      a[j]:= a[i];
    End;
  End;
  {Last sorting (by index)}
  QuickSort2(a,1,j);
  {Output}
//  Assign(f, 'simple.out'); Rewrite(f);
  For i:= 1 To j Do Begin
    Writeln(a[i].ndata);
  End;
//  Close(f);
End.
