import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.util.Map;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            TreeMap<Integer, Integer> count = new TreeMap<>();
            for (int i = n * n; i > 0; i--) {
                int a = in.nextInt();
                count.put(a, count.getOrDefault(a, 0) + 1);
            }
            int wrongCount = n * (n - 1);
            ArrayList<Integer> keys = new ArrayList<>(count.keySet());
            keys.sort((Integer f, Integer s) -> s - f);
            for (int i : keys) {
                if (count.get(i) > 1 && wrongCount > 0) {
                    int qty = count.get(i);
                    int qty2 = qty / 2;
                    if (qty2 * 2 > wrongCount) qty2 = wrongCount / 2;
                    count.put(i, qty - 2 * qty2);
                    wrongCount -= 2 * qty2;
                }
            }
            for (int i : count.keySet()) {
                int qty = count.get(i);
                for (int j = 0; j < qty; j++) {
                    out.print(i + " ");
                }
            }
        }

    }

    static class InputReader {
        private StringTokenizer tokenizer;
        private BufferedReader reader;

        public InputReader(InputStream inputStream) {
            reader = new BufferedReader(new InputStreamReader(inputStream));
        }

        private void fillTokenizer() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        }

        public String next() {
            fillTokenizer();
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

