10
6 8
3 10
1 9
6 1
8 2
5 7
3 6
10 4
3 5
 1
 5
1 2
2 3
3 4
4 5
 7
2 3
2 6
1 2
3 7
6 5
3 4
 10
8 4
8 10
8 1
8 2
5 9
5 3
5 7
8 5
5 6
 10
8 6
3 4
10 9
7 10
1 3
4 2
6 1
5 8
9 5
 10
1 10
6 9
5 4
1 3
1 2
3 8
6 7
8 6
1 5
 20
13 4
7 6
9 13
9 2
9 16
4 18
16 5
11 15
16 14
13 12
13 8
16 17
7 1
9 19
17 3
15 20
1 11
2 7
5 10
 3
1 2
1 3
 50
18 47
18 12
42 16
21 44
43 39
20 27
25 1
11 29
9 24
19 42
3 34
16 38
14 48
23 41
8 43
29 2
40 4
45 36
43 9
49 3
41 17
41 15
35 49
43 20
5 32
34 46
8 21
43 45
29 40
39 26
27 33
24 50
38 7
39 19
43 31
24 10
3 14
39 22
43 23
47 13
20 11
25 8
16 30
44 18
19 37
39 5
49 28
25 35
46 6
 15
11 2
5 13
9 4
5 7
11 5
13 14
2 10
3 11
7 1
7 6
10 15
9 12
2 9
10 8
 31
15 2
23 19
11 4
26 6
1 20
14 11
19 13
26 12
12 27
20 14
22 21
4 16
10 18
5 23
4 31
12 8
2 17
19 30
14 26
2 28
22 7
23 9
20 5
5 15
9 29
15 10
6 25
6 24
9 3
11 22
 63
34 40
43 62
33 43
49 6
17 47
26 13
35 15
40 16
17 44
37 34
18 55
57 10
16 14
39 56
36 5
4 33
4 59
54 24
37 45
21 31
57 2
19 8
43 41
49 48
15 19
35 4
15 63
30 50
11 30
59 18
20 46
18 1
33 17
31 22
40 54
63 49
29 25
46 9
16 3
42 23
59 7
54 53
42 38
8 60
8 58
7 51
36 28
63 36
21 57
25 37
45 20
25 35
19 26
20 42
30 32
11 39
7 12
31 52
45 21
26 27
34 11
46 61

9
 1
 1
 1
 1
 2
 10
 18
 2
 13
 1
 3
 1

// package codeforces.cf3xx.cf395.div1;

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Map;

public class D {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        graph = buildGraph(in, n, n-1);
        cnt = new int[n];
        map = new HashMap<>();
        value0 = new long[n][2];
        value = new long[n][2];

        mods = new long[2];
        muls = new long[2][214514];
        invmuls = new long[2][214514];

        SecureRandom rand = new SecureRandom();
        for (int i = 0; i < 2 ; i++) {
            while (mods[i] <= muls[i][1] || muls[i][1] <= 1024) {
                mods[i] = BigInteger.probablePrime(30, rand).longValue();
                muls[i][1] = BigInteger.probablePrime(28, rand).longValue();
            }
            for (int j = 2 ; j < muls[i].length; j++) {
                muls[i][j] = muls[i][j-1] * muls[i][1];
                muls[i][j] %= mods[i];
            }
            invmuls[i][invmuls[i].length-1] = inv(muls[i][muls[i].length-1], mods[i]);
            for (int j = muls[i].length-2 ; j >= 0 ; j--) {
                invmuls[i][j] = (invmuls[i][j+1] * muls[i][1]) % mods[i];
            }
            assert invmuls[i][0] == 1;
        }

        ord = new int[n][];

        dfs(0, -1);

        map = new HashMap<>();
        for (int i = 1 ; i < n ; i++) {
            addToMap(hash(value[i]), 1);
        }

        dfs2(0);

        out.println(bestV+1);
        out.flush();
    }

    private static long embrace(long value, int k, int length) {
        value *= muls[k][1];
        value += ')';
        value %= mods[k];
        value += muls[k][length+1] * '(' % mods[k];
        value %= mods[k];
        return value;
    }

    private static long hash(long[] lr) {
        return hash(lr[0], lr[1]);
    }

    private static long hash(long l, long r) {
        return (l<<32L) | r;
    }

    static long pow(long a, long x, long MOD) {
        long res = 1;
        while (x > 0) {
            if (x%2 != 0) {
                res = (res*a)%MOD;
            }
            a = (a*a)%MOD;
            x /= 2;
        }
        return res;
    }

    static long inv(long a, long MOD) {
        return pow(a, MOD-2, MOD)%MOD;
    }


    private static void addToMap(long hashValue, int inc) {
        int tv = map.getOrDefault(hashValue, 0) + inc;
        assert tv >= 0;

        if (tv == 0) {
            map.remove(hashValue);
        } else {
            map.put(hashValue, tv);
        }
    }

    private static void dfs2(int now) {
        int size = map.size() + 1;
        if (best < size) {
            best = size;
            bestV = now;
        }

        // debug(now, map);

        int leftU = 0;
        int childLen = cnt[now] * 2 - 2;

        long[] leftHash = new long[2];
        long[] rightHash = value0[now].clone();
        long[] ha = new long[2];
        for (int to : ord[now]) {
            addToMap(hash(value[to]), -1);

            int po = childLen - leftU;
            for (int k = 0 ; k <= 1 ; k++) {
                long newHash = rightHash[k];
                newHash += mods[k];
                newHash -= muls[k][po] * value[to][k] % mods[k];
                newHash += leftHash[k] * invmuls[k][cnt[to]*2] % mods[k];
                newHash %= mods[k];
                ha[k] = embrace(newHash, k, (cnt[now]-cnt[to]) * 2);
            }

            addToMap(hash(ha), 1);

            dfs2(to);

            addToMap(hash(ha), -1);

            addToMap(hash(value[to]), 1);

            for (int k = 0 ; k <= 1 ; k++) {
                leftHash[k] *= muls[k][leftU];
                leftHash[k] %= mods[k];
                leftHash[k] += value[to][k];
                leftHash[k] %= mods[k];

                rightHash[k] += mods[k];
                rightHash[k] -= muls[k][po] * value[to][k] % mods[k];
                rightHash[k] %= mods[k];
            }

            leftU += cnt[to] * 2;
        }
    }

    static int best = -1;
    static int bestV = 0;

    static long[] mods;
    static long[][] muls;
    static long[][] invmuls;

    static int[][] graph;

    static int[] cnt;

    static long[][] value0;
    static long[][] value;

    static Map<Long,Integer> map;

    static int[][] ord;

    static void dfs(int now, int par) {
        int cn = (par == -1) ? graph[now].length : graph[now].length-1;
        long[][] childHashes = new long[cn][4];
        int ci = 0;

        for (int to : graph[now]) {
            if (to == par) {
                continue;
            }
            dfs(to, now);
            childHashes[ci][0] = value[to][0];
            childHashes[ci][1] = value[to][1];
            childHashes[ci][2] = cnt[to];
            childHashes[ci][3] = to;
            ci++;
            cnt[now] += cnt[to];
        }

        Arrays.sort(childHashes, (a, b) -> {
            int k = a[0] == b[0] ? 1 : 0;
            return Long.compare(a[k], b[k]);
        });

        ord[now] = new int[cn];
        for (int i = 0 ; i < childHashes.length ; i++) {
            ord[now][i] = (int)childHashes[i][3];
        }

        long[] ans = new long[2];
        for (int k = 0 ; k <= 1 ; k++) {
            for (long[] child : childHashes) {
                ans[k] *= muls[k][(int)child[2]];
                ans[k] %= mods[k];
                ans[k] += child[k];
                ans[k] %= mods[k];
            }

            value0[now][k] = ans[k];
            ans[k] *= muls[k][1];
            ans[k] += ')';
            ans[k] %= mods[k];
            ans[k] += muls[k][cnt[now]*2+1] * '(' % mods[k];
            ans[k] %= mods[k];
            value[now][k] = ans[k];
        }
        cnt[now]++;
    }

    static int[][] buildGraph(InputReader in, int n, int m) {
        int[][] edges = new int[m][];
        int[][] graph = new int[n][];
        int[] deg = new int[n];
        for (int i = 0 ; i < m ; i++) {
            int a = in.nextInt()-1;
            int b = in.nextInt()-1;
            deg[a]++;
            deg[b]++;
            edges[i] = new int[]{a, b};
        }
        for (int i = 0 ; i < n ; i++) {
            graph[i] = new int[deg[i]];
        }
        for (int i = 0 ; i < m ; i++) {
            int a = edges[i][0];
            int b = edges[i][1];
            graph[a][--deg[a]] = b;
            graph[b][--deg[b]] = a;
        }
        return graph;
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int[] nextInts(int n) {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextInt();
            }
            return ret;
        }

        private int[][] nextIntTable(int n, int m) {
            int[][] ret = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    ret[i][j] = nextInt();
                }
            }
            return ret;
        }

        private long[] nextLongs(int n) {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextLong();
            }
            return ret;
        }

        private long[][] nextLongTable(int n, int m) {
            long[][] ret = new long[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    ret[i][j] = nextLong();
                }
            }
            return ret;
        }

        private double[] nextDoubles(int n) {
            double[] ret = new double[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextDouble();
            }
            return ret;
        }

        private int next() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public char nextChar() {
            int c = next();
            while (isSpaceChar(c))
                c = next();
            if ('a' <= c && c <= 'z') {
                return (char) c;
            }
            if ('A' <= c && c <= 'Z') {
                return (char) c;
            }
            throw new InputMismatchException();
        }

        public String nextToken() {
            int c = next();
            while (isSpaceChar(c))
                c = next();
            StringBuilder res = new StringBuilder();
            do {
                res.append((char) c);
                c = next();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public int nextInt() {
            int c = next();
            while (isSpaceChar(c))
                c = next();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = next();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c-'0';
                c = next();
            } while (!isSpaceChar(c));
            return res*sgn;
        }

        public long nextLong() {
            int c = next();
            while (isSpaceChar(c))
                c = next();
            long sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = next();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c-'0';
                c = next();
            } while (!isSpaceChar(c));
            return res*sgn;
        }

        public double nextDouble() {
            return Double.valueOf(nextToken());
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

    static void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }
}
