#define rep(i, a, n) for (int i = a; i < n; ++i) #define per(i, a, n) for (int i = n - 1; i >= a; --i) #define fi first #define se second #define pb push_back #define np next_permutation #define mp make_pair
int a[maxn], n, vis[maxn]; intmain() { ios::sync_with_stdio(false); while (cin >> n) { memset(vis, 0, sizeof(vis)); int cnt = 0; rep(i, 0, n) { int temp; cin >> temp; if (!vis[temp]) { a[cnt++] = temp; vis[temp] = 1; } } sort(a, a + cnt); cout << cnt << "\n"; cout << a[0]; rep(i, 1, cnt) { cout << " " << a[i]; } cout << "\n"; } }