Under construction

Still being built. Things may change

Appearing Numbers

Time limit2sMemory limit1024 MB

Summary
Given a sequence of N digits from 0 to 9, the task is to print each distinct digit that appears, in increasing order.
Level

Easy1 of 10

Topics
Array, Hash map
Solved
No attempts yet

Problem

A sequence A=(A1,A2,…,AN)A = (A_1, A_2, \ldots, A_N) of length NN is given, where each element is an integer from 00 to 99 inclusive. Print every integer that appears at least once in AA, in increasing order.

Input

The input is given in the following format.

N
A1   A2   …   AN

Output

Print every integer that appears at least once in AA, in increasing order, one per line. Print nothing other than the result. Do not print prompts or other text.

Constraints

  • 1≤N≤1001 \leq N \leq 100.
  • 0≤Ai≤90 \leq A_i \leq 9 (1≤i≤N1 \leq i \leq N).
  • All input values are integers.

Examples3

  1. Example 1

    Input
    8
    2 0 2 3 0 9 1 6
    
    Expected output
    0
    1
    2
    3
    6
    9
    
  2. Example 2

    Input
    3
    9 9 9
    
    Expected output
    9
    
  3. Example 3

    Input
    10
    3 1 4 1 5 9 2 6 5 3
    
    Expected output
    1
    2
    3
    4
    5
    6
    9