#include <stdio.h>
int main(){
    int N,n,a[1001];
    while(scanf("%d",&N) != EOF){
        a[0] = 0;    
        for(int i = 1; i < N+1; i++){
            scanf("%d",&n);
            a[i] = n;
            if(a[i] < a[i-1]){   //后面的都与前一位比一次,形成由小到大的顺序
                for(int j = i;j > 1;j--){
                    if(a[j] < a[j-1]){
                        a[j] = a[j-1];
                        a[j-1] = n;
                    }
                }
            }
        }
        for(int i = 1; i < N+1 ;i++){
            if(a[i] == a[i+1]) continue;    //去重输出
            printf("%d\n",a[i]);
        }
    }
    return 0;
}
}