import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(in, out);
        out.close();
    }

    private static class TaskB {

        static final long max = 10000000000000000L;
        static final double eps = 0.000001;
        private long h[];

        void solve(InputReader in, PrintWriter out) throws IOException {

            int n = in.nextInt();
            List<Integer>[] adj = new ArrayList[n];
            int played[][] = new int[n][n];
            boolean visited[] = new boolean[n];

            for (int i = 0; i < n; i++)
                adj[i] = new ArrayList<>();

            for (int i = 1; i < (n * (n - 1)) / 2; i++) {
                int a = in.nextInt();
                int b = in.nextInt();

                a--;
                b--;

                played[a][b] = 1;
                played[b][a] = 1;
                adj[a].add(b);
            }

            for (int i = 0; i < n - 1; i++)
                for (int j = i + 1; j < n; j++)
                    if (played[i][j] == 0) {
                        dfs(i, adj, visited);
                        if (visited[j])
                            out.println((i + 1) + " " + (j + 1));
                        else out.println((j + 1) + " " + (i + 1));
                        return;
                    }

        }

        void dfs(int v, List<Integer>[] adj, boolean visited[]) {

            visited[v] = true;

            for (int i = 0; i < adj[v].size(); i++) {
                int w = adj[v].get(i);
                if (!visited[w]) {
                    dfs(w, adj, visited);
                    visited[w] = true;
                }
            }

        }

        double segment(double x1, double y1, double x2, double y2) {
            return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
        }

        long gcd(long a, long b) {
            if (b == 0) return a;
            return gcd(b, a % b);
        }

        long lcm(long a, long b) {
            return (a * b) / gcd(a, b);
        }

    }

    private static class InputReader {
        StringTokenizer st;
        BufferedReader br;

        public InputReader(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public InputReader(FileReader s) throws FileNotFoundException {
            br = new BufferedReader(s);
        }

        public String next() {
            while (st == null || !st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            return st.nextToken();
        }

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

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public boolean ready() {
            try {
                return br.ready();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(in, out);
        out.close();
    }

    private static class TaskB {

        static final long max = 10000000000000000L;
        static final double eps = 0.000001;
        private long h[];

        void solve(InputReader in, PrintWriter out) throws IOException {

            int n = in.nextInt();
            int a[][] = new int[n + 1][n + 1];

            for (int i = 1; i < (n * (n - 1)) / 2; i++) {
                int k = in.nextInt();
                int j = in.nextInt();

                a[k][j]++;
                a[j][k]++;
            }

            for (int i = 1; i < n; i++)
                for (int j = i + 1; j <= n; j++)
                    if (a[i][j] == 0) {
                        out.println(i + " " + j);
                        return;
                    }

        }

        double segment(double x1, double y1, double x2, double y2) {
            return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
        }

        long gcd(long a, long b) {
            if (b == 0) return a;
            return gcd(b, a % b);
        }

        long lcm(long a, long b) {
            return (a * b) / gcd(a, b);
        }

    }

    private static class InputReader {
        StringTokenizer st;
        BufferedReader br;

        public InputReader(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public InputReader(FileReader s) throws FileNotFoundException {
            br = new BufferedReader(s);
        }

        public String next() {
            while (st == null || !st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            return st.nextToken();
        }

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

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public boolean ready() {
            try {
                return br.ready();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}


import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String [] args)
    {
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int win[]=new int[n+1];
        int tr[]=new int[n+1];

        for(int i=0;i<n ;i++)
        {
            int t1=scan.nextInt();
            int t2=scan.nextInt();
            tr[t1]++;
            tr[t2]++;
            win[t1]++;
        }
        int ans[]=new int[2];
        int x=0;
        for(int i=1 ; i<=n ;i++)
        {
            if(tr[i]==n-2)
                ans[x++]=i;
        }
        if(win[ans[0]] >=win[ans[1]])
            System.out.println(ans[0]+" "+ans[1]);
        else
            System.out.println(ans[1]+" "+ans[0]);
    }
}


import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String [] args)
    {
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int win[]=new int[n+1];
        int tr[]=new int[n+1];

        for(int i=0;i<n*(n-1)/2 -1 ;i++)
        {
            int t1=scan.nextInt();
            int t2=scan.nextInt();
            tr[t1]++;
            tr[t2]++;
            win[t1]++;
        }
        int ans[]=new int[2];
        int x=0;
        for(int i=1 ; i<=n ;i++)
        {
            if(tr[i]==n-2)
                ans[x++]=i;
        }
        if(win[ans[0]] >=win[ans[1]])
            System.out.println(ans[0]+" "+ans[1]);
        else
            System.out.println(ans[1]+" "+ans[0]);
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;

public class BetaB{

	void solve()
	{
		int n = ni();
		int m = n*(n-1)/2;
		int[] f = new int[n];
		int[] w = new int[n];
		for(int i=0;i<m-1;i++)
		{
			int x = ni()-1;
			int y = ni()-1;
			f[x]++;
			f[y]++;
			w[x]++;
		}
		int tr = 0;
		int u = 0;
		int v = 0;
		for(	;tr<n;tr++)
			if(f[tr]!=n-1)
			{
				u = tr;
				break;
			}
		for(tr++;tr<n;tr++)
			if(f[tr]!=n-1)
			{
				v = tr;
				break;
			}
		if(w[u]>w[v])
			out.println(++u + " " + ++v);
		else
			out.println(++v + " " + ++u);
	}

	public static void main(String[] args){new BetaB().start();}

	private byte[] bufferArray = new byte[1024];
	private int bufLength = 0;
	private int bufCurrent = 0;
	InputStream inputStream;
	PrintWriter out;

	void start()
	{
		inputStream = System.in;
		out = new PrintWriter(System.out);
		solve();
		out.flush();
	}

	int nextByte()
	{
		if(bufLength==-1)
			throw new InputMismatchException();
		if(bufCurrent>=bufLength)
		{
			bufCurrent = 0;
			try
			{bufLength = inputStream.read(bufferArray);}
			catch(IOException e)
			{ throw new InputMismatchException();}
			if(bufLength<=0)
				return -1;
		}
		return bufferArray[bufCurrent++];
	}

	boolean isSpaceChar(int x)
	{return (x<33 || x>126);}

	boolean isDigit(int x)
	{return (x>='0' && x<='9');}

	int nextNonSpace()
	{
		int x;
		while((x=nextByte())!=-1 && isSpaceChar(x));
		return x;
	}

	int ni()
	{
		int ans = 0;
		int sign = 1;
		int x = nextNonSpace();
		if(x=='-')
		{
			sign = -1;
			x = nextByte();
		}
		while(!isSpaceChar(x))
		{
			if(isDigit(x))
			{
				ans = ans*10 + x -'0';
				x = nextByte();
			}
			else
				throw new InputMismatchException();
		}
		return sign*ans;
	}

	long nl()
	{
		long ans = 0;
		long sign = 1;
		int x = nextNonSpace();
		if(x=='-')
		{
			sign = -1;
			x = nextByte();
		}
		while(!isSpaceChar(x))
		{
			if(isDigit(x))
			{
				ans = ans*10 + x -'0';
				x = nextByte();
			}
			else
				throw new InputMismatchException();
		}
		return sign*ans;
	}

	String ns()
	{
		StringBuilder sb = new StringBuilder();
		int x = nextNonSpace();
		while(!isSpaceChar(x))
		{
			sb.append((char)x);
			x = nextByte();
		}
		return sb.toString();
	}

	String nL()
	{
		StringBuilder sb = new StringBuilder();
		int x = nextNonSpace();
		while(x==32 || !isSpaceChar(x))
		{
			sb.append((char)x);
			x = nextByte();
		}
		return sb.toString();
	}

	char nc()
	{ return (char)nextNonSpace();}

	double nd()
	{ return (double)Double.parseDouble(ns()); }

	char[] ca()
	{ return ns().toCharArray();}

	char[] ca(int n)
	{
		char[] ans = new char[n];
		int p =0;
		int x = nextNonSpace();
		while(p<n)
		{
			ans[p++] = (char)x;
			x = nextByte();
		}
		return ans;
	}

	int[] ia(int n)
	{
		int[] ans = new int[n];
		for(int i=0;i<n;i++)
			ans[i]=ni();
		return ans;
	}

	long[] la(int n)
	{
		long[] ans = new long[n];
		for(int i=0;i<n;i++)
			ans[i] = nl();
		return ans;
	}

}


//package com.himanshu.practice.july10;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by himanshubhardwaj on 10/07/18.
 */
public class Tournament {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());

        int adj[][] = new int[n][n];
        int count[] = new int[n];

        for (int i = 1; i < ((n - 1) * n) / 2; i++) {
            String string[] = br.readLine().split(" ");
            int source = Integer.parseInt(string[0]);
            int destination = Integer.parseInt(string[1]);
            source--;
            destination--;
            count[source]++;
            count[destination]++;
            adj[source][destination] = 1;
            //System.out.println(source + " " + destination);
        }

        for (int k = 0; k < n; k++) {
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if (adj[i][k] == 1 && adj[k][j] == 1) {
                        adj[i][j] = 1;
                    }
                }
            }
        }

//        for (int i = 0; i < n; i++) {
//            for (int j = 0; j < n; j++) {
//                System.out.print(adj[i][j] + " ");
//            }
//            System.out.println();
//        }
//        System.out.println();
        int exp = n - 1;
        int souDest[] = new int[2];
        int pos = 0;
        for (int i = 0; i < n; i++) {
            if (count[i] != exp) {
                souDest[pos] = i;
                pos++;
            }
        }

        if (adj[souDest[0]][souDest[1]] == 1) {
            System.out.println((souDest[0] + 1) + " " + (souDest[1] + 1));
        } else {
            System.out.println((souDest[1] + 1) + " " + (souDest[0] + 1));
        }

    }
}


import java.io.*;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {

        new Main().solve();

    }

    //ArrayList<Integer>[] g;

    int mod = 1000000007;

    PrintWriter out;

    int n;

    ArrayList<Integer>[] g;

    void solve() throws IOException {

        //Reader in = new Reader("in.txt");
        //out = new PrintWriter( new BufferedWriter(new FileWriter("output.txt")) );
        Reader in = new Reader();
        out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out)) );

        //BufferedReader br = new BufferedReader( new FileReader("in.txt") );
        //BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );

        int n = in.nextInt();
        int k = n*(n-1)/2;

        int[] cnt = new int[n+1];
        int[] p = new int[n+1];

        for (int i = 0; i < k-1; i++) {

            int x = in.nextInt();
            int y = in.nextInt();

            cnt[x]++;
            cnt[y]++;

            p[x]++;
            p[y]--;
        }

        int p1 = -1;
        int p2 = -1;

        for (int i = 0; i < n; i++)
            if (cnt[i+1] < n-1)
                if (p1 == -1)
                    p1 = i+1;
                else
                    p2 = i+1;

        if (p[p1] >= p[p2])
            out.println(p1+" "+p2);
        else
            out.println(p2+" "+p1);

        out.flush();
        out.close();
    }

    long gcd(long a, long b) {

        if (b == 0)
            return a;

        return gcd(b, a%b);

    }

    class Pair implements Comparable<Pair>{

        int a;
        int b;

        Pair(int a, int b) {

            this.a = a;
            this.b = b;
        }

        public int compareTo(Pair p) {

            if (a < p.a)
                return -1;

            if (a > p.a)
                return 1;

            if  (b < p.b)
                return -1;

            if (b > p.b)
                return 1;

            return 0;
        }
    }

    class Item {

        int a;
        int b;
        int c;

        Item(int a, int b, int c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }

    }

    class Reader {

        BufferedReader  br;
        StringTokenizer tok;

        Reader(String file) throws IOException {
            br = new BufferedReader( new FileReader(file) );
        }

        Reader() throws IOException {
            br = new BufferedReader( new InputStreamReader(System.in) );
        }

        String next() throws IOException {

            while (tok == null || !tok.hasMoreElements())
                tok = new StringTokenizer(br.readLine());
            return tok.nextToken();
        }

        int nextInt() throws NumberFormatException, IOException {
            return Integer.valueOf(next());
        }

        long nextLong() throws NumberFormatException, IOException {
            return Long.valueOf(next());
        }

        double nextDouble() throws NumberFormatException, IOException {
            return Double.valueOf(next());
        }

        String nextLine() throws IOException {
            return br.readLine();
        }

    }

}


import java.io.*;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {

        new Main().solve();

    }

    //ArrayList<Integer>[] g;

    int mod = 1000000007;

    PrintWriter out;

    int n;

    ArrayList<Integer>[] g;

    void solve() throws IOException {

        //Reader in = new Reader("in.txt");
        //out = new PrintWriter( new BufferedWriter(new FileWriter("output.txt")) );
        Reader in = new Reader();
        out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out)) );

        //BufferedReader br = new BufferedReader( new FileReader("in.txt") );
        //BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );

        int n = in.nextInt();
        int k = n*(n-1)/2;

        int[] cnt = new int[n+1];

        for (int i = 0; i < k-1; i++) {

            int x = in.nextInt();
            int y = in.nextInt();

            cnt[x]++;
            cnt[y]++;
        }

        for (int i = 0; i < n; i++)
            if (cnt[i+1] < n-1)
                out.print((i+1)+" ");

        out.flush();
        out.close();
    }

    long gcd(long a, long b) {

        if (b == 0)
            return a;

        return gcd(b, a%b);

    }

    class Pair implements Comparable<Pair>{

        int a;
        int b;

        Pair(int a, int b) {

            this.a = a;
            this.b = b;
        }

        public int compareTo(Pair p) {

            if (a < p.a)
                return -1;

            if (a > p.a)
                return 1;

            if  (b < p.b)
                return -1;

            if (b > p.b)
                return 1;

            return 0;
        }
    }

    class Item {

        int a;
        int b;
        int c;

        Item(int a, int b, int c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }

    }

    class Reader {

        BufferedReader  br;
        StringTokenizer tok;

        Reader(String file) throws IOException {
            br = new BufferedReader( new FileReader(file) );
        }

        Reader() throws IOException {
            br = new BufferedReader( new InputStreamReader(System.in) );
        }

        String next() throws IOException {

            while (tok == null || !tok.hasMoreElements())
                tok = new StringTokenizer(br.readLine());
            return tok.nextToken();
        }

        int nextInt() throws NumberFormatException, IOException {
            return Integer.valueOf(next());
        }

        long nextLong() throws NumberFormatException, IOException {
            return Long.valueOf(next());
        }

        double nextDouble() throws NumberFormatException, IOException {
            return Double.valueOf(next());
        }

        String nextLine() throws IOException {
            return br.readLine();
        }

    }

}


import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;

@SuppressWarnings("unchecked")
public class P27B {

  public void run() throws Exception {
    int n = nextInt();

    TreeSet<Integer> pairs = new TreeSet();
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        pairs.add(i * 100 + j);
        pairs.add(j * 100 + i);
      }
    }

    int [] prior = new int [n + 1];
    for (int i = 1; i < n * (n - 1) / 2; i++) {
      int x = nextInt();
      int y = nextInt();
      pairs.remove(x * 100 + y);
      pairs.remove(y * 100 + x);
      prior[x]++;
      prior[y]--;
    }

    int x = pairs.first() / 100;
    int y = pairs.first() % 100;
    println((prior[x] > prior[y]) ? (x + " " + y) : (y + " " + x));
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P27B().run();
    br.close();
    pw.close();
    System.err.println("\n[Time : " + (System.currentTimeMillis() - startTime) + " ms]");
  }

  static long startTime = System.currentTimeMillis();
  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) { return null; }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) { print("" + b); }
  void print(int i) { print("" + i); }
  void print(long l) { print("" + l); }
  void print(double d) { print("" + d); }
  void print(char c) { print("" + c); }
  void print(Object o) {
    if (o instanceof int[]) { print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) { print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) { print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) { print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) { print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) { print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) { print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) { print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) { print(Arrays.toString((Object [])o));
    } else { print("" + o); }
  }
  void print(String s) { pw.print(s); }
  void println() { println(""); }
  void println(byte b) { println("" + b); }
  void println(int i) { println("" + i); }
  void println(long l) { println("" + l); }
  void println(double d) { println("" + d); }
  void println(char c) { println("" + c); }
  void println(Object o) { print(o); println(); }
  void println(String s) { pw.println(s); }
  int nextInt() throws IOException { return Integer.parseInt(nextToken()); }
  long nextLong() throws IOException { return Long.parseLong(nextToken()); }
  double nextDouble() throws IOException { return Double.parseDouble(nextToken()); }
  char nextChar() throws IOException { return (char) (br.read()); }
  String next() throws IOException { return nextToken(); }
  String nextLine() throws IOException { return br.readLine(); }
  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) { array[i] = nextInt(); }
    return array;
  }
  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) { array[i] = nextLong(); }
    return array;
  }
  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) { array[i] = nextDouble(); }
    return array;
  }
  String [] readLines(int size) throws IOException {
    String [] array = new String [size];
    for (int i = 0; i < size; i++) { array[i] = nextLine(); }
    return array;
  }
}


import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;

@SuppressWarnings("unchecked")
public class P27B {

  public void run() throws Exception {
    int n = nextInt();

    TreeSet<Integer> pairs = new TreeSet();
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        pairs.add((i << 6) | j);
        pairs.add((j << 6) | i);
      }
    }

    int [] prior = new int [n];
    for (int i = 1; i < n * (n - 1) / 2; i++) {
      int x = nextInt() - 1;
      int y = nextInt() - 1;
      pairs.remove((x << 6) | y);
      pairs.remove((y << 6) | x);
      prior[x]++;
      prior[y]--;
    }

    int x = pairs.first() >> 6;
    int y = pairs.first() & 63;
    println((prior[x] >= prior[y]) ? ((x + 1) + " " + (y + 1)) : ((y + 1) + " " + (x + 1)));
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P27B().run();
    br.close();
    pw.close();
    System.err.println("\n[Time : " + (System.currentTimeMillis() - startTime) + " ms]");
  }

  static long startTime = System.currentTimeMillis();
  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) { return null; }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) { print("" + b); }
  void print(int i) { print("" + i); }
  void print(long l) { print("" + l); }
  void print(double d) { print("" + d); }
  void print(char c) { print("" + c); }
  void print(Object o) {
    if (o instanceof int[]) { print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) { print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) { print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) { print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) { print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) { print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) { print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) { print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) { print(Arrays.toString((Object [])o));
    } else { print("" + o); }
  }
  void print(String s) { pw.print(s); }
  void println() { println(""); }
  void println(byte b) { println("" + b); }
  void println(int i) { println("" + i); }
  void println(long l) { println("" + l); }
  void println(double d) { println("" + d); }
  void println(char c) { println("" + c); }
  void println(Object o) { print(o); println(); }
  void println(String s) { pw.println(s); }
  int nextInt() throws IOException { return Integer.parseInt(nextToken()); }
  long nextLong() throws IOException { return Long.parseLong(nextToken()); }
  double nextDouble() throws IOException { return Double.parseDouble(nextToken()); }
  char nextChar() throws IOException { return (char) (br.read()); }
  String next() throws IOException { return nextToken(); }
  String nextLine() throws IOException { return br.readLine(); }
  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) { array[i] = nextInt(); }
    return array;
  }
  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) { array[i] = nextLong(); }
    return array;
  }
  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) { array[i] = nextDouble(); }
    return array;
  }
  String [] readLines(int size) throws IOException {
    String [] array = new String [size];
    for (int i = 0; i < size; i++) { array[i] = nextLine(); }
    return array;
  }
}


import java.util.Scanner;
public class b27 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int s = n*(n-1)/2-1;
		int[] a= new int[s];
		int[] b= new int[s];
		for (int i=0; i<s; i++) {
			a[i]=sc.nextInt();
			b[i]=sc.nextInt();
		}
		for (int i=1; i<=n; i++) {
			for (int j=1; j<=n; j++) {
			   if (i>j) {
				  boolean found=false;
			      for(int k=0; k<s; k++) {
			    	  if ((a[k]==i && b[k]==j) || (a[k]==j && b[k]==i)) {
			    		  found=true;
			    		  break;
			    	  }
			      }
				  if (!found) {
				     System.out.println(i + " " + j);
				  }
			   }
			}
		}
	}
}


import java.util.Scanner;
public class b27 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int s = n*(n-1)/2-1;
		int[] a= new int[s];
		int[] b= new int[s];
		int[] p = new int[n+1];
		for (int i=0; i<s; i++) {
			a[i]=sc.nextInt();
			b[i]=sc.nextInt();
			p[a[i]]+=1;
		}
		for (int i=1; i<=n; i++) {
			for (int j=1; j<=n; j++) {
			   if (i>j) {
				  boolean found=false;
			      for(int k=0; k<s; k++) {
			    	  if ((a[k]==i && b[k]==j) || (a[k]==j && b[k]==i)) {
			    		  found=true;
			    		  break;
			    	  }
			      }
				  if (!found) {
					 if(p[i]>p[j]) {
					     System.out.println(i + " " + j);
					 } else {
					     System.out.println(j + " " + i);
					 }
				  }
			   }
			}
		}
	}
}


import java.util.Scanner;
public class b27 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int s = n*(n-1)/2-1;
		int[] a= new int[s];
		int[] b= new int[s];
		for (int i=0; i<s; i++) {
			a[i]=sc.nextInt();
			b[i]=sc.nextInt();
		}
		for (int i=1; i<=n; i++) {
			for (int j=1; j<=n; j++) {
			   if (i<j) {
				  boolean found=false;
			      for(int k=0; k<s; k++) {
			    	  if ((a[k]==i && b[k]==j) || (a[k]==j && b[k]==i)) {
			    		  found=true;
			    		  break;
			    	  }
			      }
				  if (!found) {
				     System.out.println(i + " " + j);
				  }
			   }
			}
		}
	}
}


//package B;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Tournament {
    static int n;
    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader =
                new BufferedReader(
                        new InputStreamReader(System.in));
        n = Integer.parseInt(bufferedReader.readLine());
        int[] games = new int[n + 1];
        int[] loses = new int[n + 1];
        int to =( (n * (n - 1) ) / 2 ) - 1;
        for(int i = 0;i < to;i++) {
            String[] data = bufferedReader.readLine().split(" ");
            int xi = Integer.parseInt(data[0]);
            int yi = Integer.parseInt(data[1]);
            games[xi]++;
            games[yi]++;
            loses[yi]++;
          //  System.out.printf("%d %d\n",xi,yi);
        }
        int[] teams = new int[2];
        int t = 0;
        for(int i = 1;i < games.length;i++) {
            if(games[i] < n - 1) {
                teams[t] = i;
                t++;
            }
        }
        if(loses[teams[0]] < loses[teams[1]]) {
            System.out.println(teams[0] + " " + teams[1]);
        } else {
            System.out.println(teams[1] + " " + teams[0]);
        }
    }
}


import java.io.*;
import java.util.*;

public class Main{
    static double getDistance( double x , double y , double x1 , double y1 )
    {
        double sx = Math.pow( x - x1 , 2 );
        double sy = Math.pow( y - y1 , 2 );
        return Math.sqrt( sx + sy );
    }
    public static void main(String[] args) {
        MyScanner scanner = new MyScanner();
        int n = scanner.nextInt();
        int games[] = new int[ n + 1 ], wins[] = new int [ n + 1];
        int cnt = ( ( n * ( n - 1 ) ) / 2 ) - 1;
        int x, y;
        for( int i = 0; i < cnt ; i++ )
        {
            x = scanner.nextInt();
            y = scanner.nextInt();
            wins[ x ]++;
            games[ x ]++;
            games[ y ]++;
        }
        x = 0;
        y = 0;
        for( int i = 1 ; i <= n ; i++ )
        {
            if( games[i] < n - 1 ){
                if( x == 0 )
                {
                    x = i;
                }
                else {
                    y = i;
                    break;
                }
            }
        }
        if( wins[ x ] < wins[ y ] )
        {
            int t = x;
            x = y;
            y = t;
        }
        System.out.println( x + " " + y );
    }

}

class MyScanner {
    BufferedReader br;
    StringTokenizer st;

    public MyScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public int mod(long x) {
        // TODO Auto-generated method stub
        return (int) x % 1000000007;
    }

    public int mod(int x) {
        return x % 1000000007;
    }

    boolean hasNext() {
        if (st.hasMoreElements())
            return true;
        try {
            st = new StringTokenizer(br.readLine());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st.hasMoreTokens();
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

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

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
    public int[] readIntArray( int n )
    {
        int ar[] = new int[ n ];
        for( int i = 0;  i < n ; i++ )
            ar[ i ] = this.nextInt();
        return ar;
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
}


import java.io.*;
import java.util.*;

public  class CodeForce {
	public static boolean dfs(int[][] graph,int k,int b)
	{

		Queue<Integer> q=new LinkedList<>();
		q.add(k);
		int n=graph.length;
	boolean[] vis=new boolean[n];
	vis[k]=true;
		while(!q.isEmpty())
		{int u=q.poll();

		for(int i=0;i<n;i++)
		{
			if(graph[u][i]==1&&vis[i]!=true)
			{q.add(i);vis[i]=true;
			if(i==b)
				return true;}

		}

		}
		return false;

	}

static	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static StringBuilder sb = new StringBuilder();

	public static int getsum(String sr)
	{
		int n=sr.length();
		int x=Integer.parseInt(sr);
		int total=0;
		while(x!=0)
		{
			total+=x%10;
			x=x/10;

		}
		return total;
	}
	static int next(String [] sr,int ind)
	{
		return Integer.parseInt(sr[ind]);
	}

	public static void main(String[] args) throws IOException {

	String[] sr=br.readLine().split(" ");

int n=next(sr,0);
int t=n*(n-1)/2-1;
int[][] arr=new int[n][n];
int[] count=new int[n];
for(int i=0;i<t;i++)
{sr=br.readLine().split(" ");

int x=next(sr,0);
int y=next(sr,1);
arr[x-1][y-1]=1;
count[x-1]++;
count[y-1]++;

}
int a=-1;
int b=-1;
for(int i=0;i<n;i++)
{
	if(count[i]!=n-1)
	{
		if(a==-1)
			a=i+1;
		else b=i+1;
	}

}
if(dfs(arr,a-1,b-1))
	System.out.println(a+" "+b);
else System.out.println(b+" "+a);

}
}


import java.io.*;
import java.util.*;

public  class CodeForce {
	public static boolean dfs(int[][] graph,int k,int b)
	{

		Queue<Integer> q=new LinkedList<>();
		q.add(k);
		int n=graph.length;
	boolean[] vis=new boolean[n];
	vis[k]=true;
		while(!q.isEmpty())
		{int u=q.poll();

		for(int i=0;i<n;i++)
		{
			if(graph[u][i]==1&&vis[i]!=true)
			{q.add(i);vis[i]=true;
			if(i==b)
				return true;}

		}

		}
		return false;

	}

static	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static StringBuilder sb = new StringBuilder();

	public static int getsum(String sr)
	{
		int n=sr.length();
		int x=Integer.parseInt(sr);
		int total=0;
		while(x!=0)
		{
			total+=x%10;
			x=x/10;

		}
		return total;
	}
	static int next(String [] sr,int ind)
	{
		return Integer.parseInt(sr[ind]);
	}

	public static void main(String[] args) throws IOException {

	String[] sr=br.readLine().split(" ");

int n=next(sr,0);
int t=n*(n-1)/2-1;
int[][] arr=new int[n][n];
int[] count=new int[n];
for(int i=0;i<t;i++)
{sr=br.readLine().split(" ");

int x=next(sr,0);
int y=next(sr,1);
arr[x-1][y-1]=1;
count[x-1]++;
count[y-1]++;

}
int a=-1;
int b=-1;
for(int i=0;i<n;i++)
{
	if(count[i]!=n-1)
	{
		if(a==-1)
			a=i+1;
		else b=i+1;
	}

}
if(dfs(arr,a,b))
	System.out.println(a+" "+b);
else System.out.println(b+" "+a);

}
}


import java.io.BufferedInputStream;
import java.io.IOException;
import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * Created by jizhe on 2016/1/8.
 */
public class Tournament {
    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

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

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

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

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

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

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

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }

    private static boolean dfs(int[][] pairs, int a, int b, boolean[] marked)
    {
        if( a == b )
        {
            return true;
        }

        boolean result = false;
        for( int i = 0; i < pairs.length; i++ )
        {
            if( !marked[i] && pairs[i][0] == a )
            {
                marked[i] = true;
                result |= dfs(pairs, pairs[i][1], b, marked);
            }
        }

        return result;
    }

    public static void main(String[] args) {
        //Scanner in = new Scanner(new BufferedInputStream(System.in));
        FasterScanner in = new FasterScanner();

        int N = in.nextInt();
        int M = N*(N-1)/2-1;
        int[][] pairs = new int[M][2];
        int[] stat = new int[N+1];
        for( int i = 0; i < M; i++ )
        {
            pairs[i][0] = in.nextInt();
            pairs[i][1] = in.nextInt();
            stat[pairs[i][0]]++;
            stat[pairs[i][1]]++;
        }

        int a = 0, b = 0;
        for( int i = 1; i < N+1; i++ )
        {
            if( stat[i] != N-1 )
            {
                if( a == 0 )
                {
                    a = i;
                }
                else
                {
                    b = i;
                    break;
                }
            }
        }

        boolean[] marked = new boolean[M];

        if( dfs(pairs, a, b, marked) )
        {
            System.out.printf("%d %d\n", a, b);
        }
        else
        {
            System.out.printf("%d %d\n", b, a);
        }
    }
}


import java.io.BufferedInputStream;
import java.io.IOException;
import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * Created by jizhe on 2016/1/8.
 */
public class Tournament {
    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

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

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

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

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

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

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

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }

    public static void main(String[] args) {
        //Scanner in = new Scanner(new BufferedInputStream(System.in));
        FasterScanner in = new FasterScanner();

        int N = in.nextInt();
        int M = N*(N-1)/2-1;
        int[][] pairs = new int[M][2];
        int[] stat = new int[N+1];
        for( int i = 0; i < M; i++ )
        {
            pairs[i][0] = in.nextInt();
            pairs[i][1] = in.nextInt();
            stat[pairs[i][0]]++;
            stat[pairs[i][1]]++;
        }

        int a = 0, b = 0;
        for( int i = 1; i < N+1; i++ )
        {
            if( stat[i] != N-1 )
            {
                if( a == 0 )
                {
                    a = i;
                }
                else
                {
                    b = i;
                    break;
                }
            }
        }

        boolean[] marked = new boolean[M];
        int next = -1;
        while( next != 0 && next != b )
        {
            next = 0;
            for( int i = 0; i < M; i++ )
            {
                if( !marked[i] && pairs[i][0] == a )
                {
                    next = pairs[i][1];
                    marked[i] = true;
                    break;
                }
            }
        }

        if( next == 0 )
        {
            System.out.printf("%d %d\n", b, a);
        }
        else
        {
            System.out.printf("%d %d\n", a, b);
        }
    }
}


		    /*
		     * Author- Priyam Vora
		     * BTech 2nd Year DAIICT
		     */

		    import java.io.*;
		    import java.math.*;
	import java.net.NetworkInterface;
	import java.util.*;
		    import javax.print.attribute.SetOfIntegerSyntax;

		    public class CodeMonk_Graph {
		    	private static InputStream stream;
		    	private static byte[] buf = new byte[1024];
		    	private static int curChar;
		    	private static int numChars;
		    	private static SpaceCharFilter filter;
		    	private static PrintWriter pw;
		    	private static long count = 0,mod=1000000007;
		    	private static TreeSet<Integer>ts[]=new TreeSet[200000];
		    	private static HashSet hs=new HashSet();

		    	public static void main(String args[]) throws Exception {
		    		InputReader(System.in);
		    		pw = new PrintWriter(System.out);
		    		//ans();
		    		soln();
		    		pw.close();
		    	}

		    	public static long gcd(long x, long y) {
		    		if (x == 0)
		    			return y;
		    		else
		    			return gcd( y % x,x);
		    	}

		    	private static int BinarySearch(int a[], int low, int high, int target) {
		    		if (low > high)
		    			return -1;
		    		int mid = low + (high - low) / 2;
		    		if (a[mid] == target)
		    			return mid;
		    		if (a[mid] > target)
		    			high = mid - 1;
		    		if (a[mid] < target)
		    			low = mid + 1;
		    		return BinarySearch(a, low, high, target);
		    	}

		    	public static String reverseString(String s) {
		    		StringBuilder sb = new StringBuilder(s);
		    		sb.reverse();
		    		return (sb.toString());
		    	}

		    	public static long pow(long n, long p) {
		    		if(p==0)
		    			return 1;
		    		if(p==1)
		    			return n%mod;
		    		if(p%2==0){
		    			long temp=pow(n, p/2);
		    		return (temp*temp)%mod;
		    		}else{
		    			 	long temp=pow(n,p/2);
		    			 	temp=(temp*temp)%mod;
		    			 	return(temp*n)%mod;

		    		}
		    	}

		    	public static int[] radixSort(int[] f) {
		    		int[] to = new int[f.length];
		    		{
		    			int[] b = new int[65537];
		    			for (int i = 0; i < f.length; i++)
		    				b[1 + (f[i] & 0xffff)]++;
		    			for (int i = 1; i <= 65536; i++)
		    				b[i] += b[i - 1];
		    			for (int i = 0; i < f.length; i++)
		    				to[b[f[i] & 0xffff]++] = f[i];
		    			int[] d = f;
		    			f = to;
		    			to = d;
		    		}
		    		{
		    			int[] b = new int[65537];
		    			for (int i = 0; i < f.length; i++)
		    				b[1 + (f[i] >>> 16)]++;
		    			for (int i = 1; i <= 65536; i++)
		    				b[i] += b[i - 1];
		    			for (int i = 0; i < f.length; i++)
		    				to[b[f[i] >>> 16]++] = f[i];
		    			int[] d = f;
		    			f = to;
		    			to = d;
		    		}
		    		return f;
		    	}

		    	public static int nextPowerOf2(final int a) {
		    		int b = 1;
		    		while (b < a) {
		    			b = b << 1;
		    		}
		    		return b;
		    	}

		    	public static boolean PointInTriangle(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {
		    		int s = p2 * p5 - p1 * p6 + (p6 - p2) * p7 + (p1 - p5) * p8;
		    		int t = p1 * p4 - p2 * p3 + (p2 - p4) * p7 + (p3 - p1) * p8;

		    		if ((s < 0) != (t < 0))
		    			return false;

		    		int A = -p4 * p5 + p2 * (p5 - p3) + p1 * (p4 - p6) + p3 * p6;
		    		if (A < 0.0) {
		    			s = -s;
		    			t = -t;
		    			A = -A;
		    		}
		    		return s > 0 && t > 0 && (s + t) <= A;
		    	}

		    	public static float area(int x1, int y1, int x2, int y2, int x3, int y3) {
		    		return (float) Math.abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0);
		    	}

		    	public static boolean isPrime(int n) {
		    		// Corner cases
		    		if (n <= 1)
		    			return false;
		    		if (n <= 3)
		    			return true;

		    		// This is checked so that we can skip
		    		// middle five numbers in below loop
		    		if (n % 2 == 0 || n % 3 == 0)
		    			return false;

		    		for (int i = 5; i * i <= n; i = i + 6)
		    			if (n % i == 0 || n % (i + 2) == 0)
		    				return false;

		    		return true;
		    	}

		    	//merge Sort

		    	static long sort(int a[])
		    	{  int n=a.length;
		    		int b[]=new int[n];
		    		return mergeSort(a,b,0,n-1);}
		    	static long mergeSort(int a[],int b[],long left,long right)
		    	{ long c=0;if(left<right)
		    	 {   long mid=left+(right-left)/2;
		    		 c= mergeSort(a,b,left,mid);
		    		 c+=mergeSort(a,b,mid+1,right);
		    		 c+=merge(a,b,left,mid+1,right); }
		    		return c;	 }
		    	static long merge(int a[],int  b[],long left,long mid,long right)
		    	{long c=0;int i=(int)left;int j=(int)mid; int k=(int)left;
		    	while(i<=(int)mid-1&&j<=(int)right)
		    	{ if(a[i]>a[j]) {b[k++]=a[i++]; }
		    	else	{ b[k++]=a[j++];c+=mid-i;}}
		    	while (i <= (int)mid - 1)   b[k++] = a[i++];
		    	while (j <= (int)right) b[k++] = a[j++];
		    	for (i=(int)left; i <= (int)right; i++)
		    		a[i] = b[i];  return c;  }
		    	public static boolean isSubSequence(String large, String small, int largeLen, int smallLen) {
		    		//base cases
		    		if (largeLen == 0)
		    			return false;
		    		if (smallLen == 0)
		    			return true;
		    		// If last characters of two strings are matching
		    		if (large.charAt(largeLen - 1) == small.charAt(smallLen - 1))
		    			isSubSequence(large, small, largeLen - 1, smallLen - 1);
		    		// If last characters are not matching
		    		return isSubSequence(large, small, largeLen - 1, smallLen);
		    	}

		    	// To Get Input
		    	// Some Buffer Methods

		    	public static void InputReader(InputStream stream1) {
		    		stream = stream1;
		    	}

		    	private static boolean isWhitespace(int c) {
		    		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		    	}

		    	private static boolean isEndOfLine(int c) {
		    		return c == '\n' || c == '\r' || c == -1;
		    	}

		    	private static int read() {
		    		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++];
		    	}

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

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

		    	private static String nextToken() {
		    		int c = read();
		    		while (isSpaceChar(c))
		    			c = read();
		    		StringBuilder res = new StringBuilder();
		    		do {
		    			res.appendCodePoint(c);
		    			c = read();
		    		} while (!isSpaceChar(c));
		    		return res.toString();
		    	}

		    	private static String nextLine() {
		    		int c = read();
		    		while (isSpaceChar(c))
		    			c = read();
		    		StringBuilder res = new StringBuilder();
		    		do {
		    			res.appendCodePoint(c);
		    			c = read();
		    		} while (!isEndOfLine(c));
		    		return res.toString();
		    	}

		    	private static int[] nextIntArray(int n) {
		    		int[] arr = new int[n];
		    		for (int i = 0; i < n; i++) {
		    			arr[i] = nextInt();
		    		}
		    		return arr;
		    	}

		    	private static int[][] next2dArray(int n, int m) {
		    		int[][] arr = new int[n][m];
		    		for (int i = 0; i < n; i++) {
		    			for (int j = 0; j < m; j++) {
		    				arr[i][j] = nextInt();
		    			}
		    		}
		    		return arr;
		    	}
		    	private static char[][] nextCharArray(int n,int m){
		    		char [][]c=new char[n][m];
		    		for(int i=0;i<n;i++){
		    			String s=nextLine();
		    			for(int j=0;j<s.length();j++){
		    				c[i][j]=s.charAt(j);
		    			}
		    		}
		    		return c;
		    	}

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

		    	private static void pArray(int[] arr) {
		    		for (int i = 0; i < arr.length; i++) {
		    			pw.print(arr[i] + " ");
		    		}
		    		pw.println();
		    		return;
		    	}

		    	private static void pArray(long[] arr) {
		    		for (int i = 0; i < arr.length; i++) {
		    			pw.print(arr[i] + " ");
		    		}
		    		pw.println();
		    		return;
		    	}

		    	private static void pArray(boolean[] arr) {
		    		for (int i = 0; i < arr.length; i++) {
		    			pw.print(arr[i] + " ");
		    		}
		    		pw.println();
		    		return;
		    	}

		    	private static boolean isSpaceChar(int c) {
		    		if (filter != null)
		    			return filter.isSpaceChar(c);
		    		return isWhitespace(c);
		    	}

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

		    	//----------------------------------------My Code------------------------------------------------//

		    	private static void soln() {

	int n=nextInt();
	int k=(n*(n-1))/2;
	Pair[] p=new Pair[k-1];
	int wins[]=new int[n+1];
	int played[]=new int[n+1];
	for(int i=0;i<k-1;i++){
		int v=nextInt();
		int w=nextInt();
	played[v]++;
	played[w]++;
		wins[v]++;
	}
	ArrayList<Integer> ar=new ArrayList();
	for(int i=1;i<=n;i++){
		if(played[i]<(n-1)){
			ar.add(i);
		}
	}
	int v=ar.get(0);
	int w=ar.get(1);
	if(wins[v]>wins[w]){
		pw.println(v+" "+w);
	}else{
		pw.println(w+" "+v);
	}

		    		//-----------------------------------------The End--------------------------------------------------------------------------//

		 }
		    	static boolean primeFac(int n){
		    		long c=0;
		    		int flag=1;
		    		HashSet hs=new HashSet();
		    		while(n%2==0){
		    			n=n/2;
		    			flag=0;

		    		}
		    		if(flag==0)
		    			c++;
		    		flag=1;
		    		for(int i=3;i<=Math.sqrt(n);i+=2){
		    			while(n%i==0){
		    				hs.add(i);
		    				n=n/i;
		    				flag=0;

		    			}
		    			if(flag==0)
		    				c++;
		    			flag=1;
		    		}
		    		if(n>2){c++;
		    		}
		    		if(c==2){
		    			return true;
		    		}
		    		return false;
		    	}

		    }

			class Pair implements Comparable<Pair>{
			    long id;
				long w;
				long h;
				Pair(long id,long w,long h){
					this.id=id;
					if(w>h){
						long temp=w;
						w=h;
						h=temp;
						}
					this.w=w;
					this.h=h;
				}
				@Override
				public int compareTo(Pair o) {
					// TODO Auto-generated method stub
				//	Sort in increasing order
					if(w>o.w){
						return 1;
					}else if(w<o.w){
						return -1;
					}else{
						if(h>o.h)
							return 1;
						else if(h<o.h)
							return -1;
						else
						return 0;
					}

				}

			}
		        class Graph{
		        	private static int V,level[][],count=-1,lev_dfs[],degree=0,no_vert_conn_comp=0;
		        	private Stack <Integer>st=new Stack();
		        	private static LinkedList<Integer > adj[];
		        	private boolean[][] Visite;
		        	private static boolean [] Visited;
		        	private static TreeSet<Integer> ts=new TreeSet();
		        	private static HashMap<String,Integer> hm=new HashMap<>();
		    Graph(int V){
		    V++;
		    this.V=(V);
		    adj=new LinkedList[V];
		    Visite=new boolean[100][100];

	 	   Visited=new boolean[V];
		    level=new int[100][100];
		   lev_dfs=new int[V];
		   for(int i=0;i<V;i++)
			   adj[i]=new LinkedList<Integer>();
		    }

		    void addEdge(int v,int w,int c){

		    	if(adj[v]==null){
		    		adj[v]=new LinkedList();
		    	}
		    	adj[v].add(w);
		     String s="";
		     s+=(v+" "+w);
		    hm.put(s, c);
		    }

		    public static int BFS2(int startVert,int dest){
		    	Visited=new boolean[V];
		    	for(int i=1;i<V;i++){
		    		lev_dfs[i]=-1;
		    	}
		    	Queue<Integer> q=new LinkedList<Integer>();
		    	q.add(startVert);

		    	lev_dfs[startVert]=0;
		    	while(!q.isEmpty()){
		    		int top=q.poll();

		    		Iterator<Integer> i= adj[top].listIterator();
		    		while(i.hasNext()){
		    			int n=i.next();
		    			if(!Visited[n]){
		    				q.add(n);
		    				Visited[n]=true;
		    				lev_dfs[n]=lev_dfs[top]+1;
		    			if(n==dest){
		    				q.clear();
		    				return lev_dfs[n];

		    			}
		    			}
		    		}
		    	}
		    	q.clear();
		    	return -1;
		    }
		    public int getEd(){
		    	return degree/2;
		    }
		    public void get(int from,int to){
		    	int h=lev_dfs[from]-lev_dfs[to];
		    	if(h<=0){
		    		System.out.println(-1);
		    	}else{
		    		System.out.println(h-1);
		    	}
		    }
		    private static boolean check(int x,int y,char c[][]){

				if((x>=0 && y>=0) && (x<c.length && y<c[0].length) && c[x][y]!='#'){

					return true;
				}
				return false;
			}
		    public int BFS(int x,int y,int k,char[][] c)
		    {
		    	 LinkedList<Pair> queue = new LinkedList<Pair>();
		        //Visited[s]=true;
		   //     queue.add(new Pair(x,y));
		       int count=0;
		   level[x][y]=-1;
		   c[x][y]='M';
		        while (!queue.isEmpty())
		        {
		            Pair temp = queue.poll();
		            //x=temp.idx;
		            //y=temp.val;

		            c[x][y]='M';
		      // System.out.println(x+" "+y+" ---"+count);
		         count++;
		     	if(count==k)
		         {
		         	for(int i=0;i<c.length;i++){
		         		for(int j=0;j<c[0].length;j++){
		         			if(c[i][j]=='M'){
		         				System.out.print(".");
		         			}
		         			else if(c[i][j]=='.')
		         				System.out.print("X");
		         			else
		         				System.out.print(c[i][j]);
		         		}
		         		System.out.println();
		         	}
		         System.exit(0);
		         }

		         // System.out.println(x+" "+y);
		           // V--;

		        }
		        return V;
		    }

		    private void getAns(int startVertex){
		    	for(int i=0;i<adj[startVertex].size();i++){
		    		int ch=adj[startVertex].get(i);
		    		for(int j=0;j<adj[ch].size();j++){
		    			int ch2=adj[ch].get(j);
		    			if(adj[ch2].contains(startVertex)){
		    				System.out.println(startVertex+" "+ch+" "+ch2);
		    				System.exit(0);
		    			}
		    		}
		    	}
		    }

		     public long dfs(int startVertex){
		    //	 getAns(startVertex);
		    	 long ans=Long.MAX_VALUE;
		    	 //Visited=new boolean[V];
		    	 if(!Visited[startVertex])  {
		    for(int i=0;i<adj[startVertex].size();i++){
		    	 Visited=new boolean[V];

		    	long t= dfsUtil(adj[startVertex].get(i),Visited);
		    //	System.out.println(t+")))");
			     	ans=Math.min(ans, t);
		    }
		   	//return getAns();
		    	}

		    return ans;
		    	}
		 private long dfsUtil(int startVertex, boolean[] Visited) {//0-Blue 1-Pink
		//System.out.println(startVertex);
			 long cost=0;
			// Visited[1]=true;
			// System.out.println(startVertex);
			 String ss="";
			 ss+=(1+" "+startVertex);
		//	System.out.println(hm.get(ss));
			 cost+=hm.get(ss);
			 int c=1;
			 long cout=0;
		      degree=0;
		    	Visited[startVertex]=true;
		    //	lev_dfs[startVertex]=1;
		      st.push(startVertex);
		    while(!st.isEmpty()){

		    	int top=st.pop();

		   	Iterator<Integer> i=adj[top].listIterator();
		     degree+=adj[top].size();

		    while(i.hasNext()){
		// System.out.println(top+" "+adj[top].size());
		    	int n=i.next();
		 // 	System.out.println(top+" "+n);

		  	if( !Visited[n]){
		    	 if(n==1 && startVertex==top){
		   // 		 System.out.println("---");
		    	 }else{
		    				Visited[n]=true;
		    					st.push(n);
		    				//	System.out.print(n+" ");
		    					lev_dfs[n]=top;
		    					String s="";
		    					s+=(top+" "+n);
		    				//System.out.println(hm.get(s));
		    			cost+=hm.get(s);
		    		 }
		     }
		         }
		//System.out.println("--------------------------------");
		 }

		    return cost;

		  //  System.out.println("NO");
		   // return c;

		    }

		        }

		    class Dsu{
		    	private int rank[], parent[] ,n;

		    	Dsu(int size){
		    		this.n=size+1;
		    		rank=new int[n];
		    		parent=new int[n];
		    	makeSet();
		    	}

		    	void makeSet(){
		    		for(int i=0;i<n;i++){
		    			parent[i]=i;
		    		}
		    	}

		    	int find(int x){
		    		if(parent[x]!=x){

		    			parent[x]=find(parent[x]);
		    		}
		    		return parent[x];
		    	}

		    	void union(int x,int y){
		    		int xRoot=find(x);
		    		int yRoot=find(y);

		    		if(xRoot==yRoot)
		    			return;
		    		if(rank[xRoot]<rank[yRoot]){
		    		parent[xRoot]=yRoot;
		    		}else if(rank[yRoot]<rank[xRoot]){
		    			parent[yRoot]=xRoot;
		    		}else{
		    			parent[yRoot]=xRoot;
		    			rank[xRoot]++;
		    		}

		    	}

		    }
		    class Heap{

		    	public static void build_max_heap(long []a,int size){

		    		for(int i=size/2;i>0;i--){
		    			max_heapify(a, i,size);
		    		}

		    			}
		    	private static void max_heapify(long[] a,int i,int size){
		    		int left_child=2*i;
		    		int right_child=(2*i+1);
		    		int largest=0;

		    		if(left_child<size && a[left_child]>a[i]){
		    			largest=left_child;
		    		}else{
		    			largest=i;
		    		}

		    		if(right_child<size && a[right_child]>a[largest]){
		    			largest=right_child;
		    		}
		    		if(largest!=i){
		    			long temp=a[largest];
		    			a[largest]=a[i];
		    			a[i]=temp;
		    			max_heapify(a, largest,size);
		    		}
		    	}
		    	private static void min_heapify(int[] a,int i){
		    		int left_child=2*i;
		    		int right_child=(2*i+1);
		    		int largest=0;

		    		if(left_child<a.length && a[left_child]<a[i]){
		    			largest=left_child;
		    		}else{
		    			largest=i;
		    		}

		    		if(right_child<a.length && a[right_child]<a[largest]){
		    			largest=right_child;
		    		}
		    		if(largest!=i){
		    			int temp=a[largest];
		    			a[largest]=a[i];
		    			a[i]=temp;
		    			min_heapify(a, largest);
		    		}
		    	}
		    	public static void extract_max(int size,long a[]){
		    		if(a.length>1){
		    			long max=a[1];
		    			a[1]=a[a.length-1];
		    			size--;
		    			max_heapify(a, 1,a.length-1);
		    		}
		    	}
		    }

		    class MyComp implements Comparator<Long>{

				@Override
				public int compare(Long o1, Long o2) {
					if(o1<o2){
						return 1;
					}else if(o1>o2){
						return -1;
					}
					return 0;

				}
		    }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;

public class P27B {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(in, out);
        out.close();
    }

    static class Task {
        public void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            Set<Pair> st = new HashSet<>();
            Set<Integer>[] adj = new Set[n + 1];
            for (int i = 1; i <= n; i++)
                adj[i] = new HashSet<>();
            for (int i = 0; i < n * (n - 1) / 2 - 1; i++) {
                Pair p = new Pair(in.nextInt(), in.nextInt());
                st.add(p);
                adj[p.a].add(p.b);
            }
            for (int i = 1; i <= n; i++) {
                for (int j = i + 1; j <= n; j++) {
                    if (!st.contains(new Pair(i, j))) {
                        if (reachable(i, j, adj)) out.println(i + " " + j);
                        else /*if (reachable(j, i, adj))*/ out.println(j + " " + i);
                        return;
                    }
                }
            }
        }

        private boolean reachable(int s, int e, Set<Integer>[] adj) {
            Set<Integer> visited = new HashSet<Integer>();
            Stack<Integer> stack = new Stack<>();
            stack.push(s);
            while (!stack.isEmpty()) {
                int element = stack.pop();
                visited.add(element);
                if (element == e) return true;
                for (int child : adj[element])
                    if (!visited.contains(child)) stack.push(child);
            }
            return false;
        }

        public static class Pair {
            int a;
            int b;

            public Pair(int x, int y) {
                a = x;
                b = y;
            }

            @Override
            public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + Math.min(a, b);
                result = prime * result + Math.max(a, b);
                return result;
            }

            @Override
            public boolean equals(Object obj) {
                Pair other = (Pair) obj;
                if (Math.min(a, b) != Math.min(other.a, other.b)) return false;
                if (Math.max(a, b) != Math.max(other.a, other.b)) return false;
                return true;
            }

        }
    }

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

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
                arr[i] = nextInt();
            return arr;
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;

public class P27B {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(in, out);
        out.close();
    }

    static class Task {
        public void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            Set<Pair> st = new HashSet<>();
            Set<Integer>[] adj = new Set[n + 1];
            for (int i = 1; i <= n; i++)
                adj[i] = new HashSet<>();
            for (int i = 0; i < n * (n - 1) / 2 - 1; i++) {
                Pair p = new Pair(in.nextInt(), in.nextInt());
                st.add(p);
                adj[p.a].add(p.b);
            }
            for (int i = 1; i <= n; i++) {
                for (int j = i + 1; j <= n; j++) {
                    if (!st.contains(new Pair(i, j))) {
                        if (reachable(i, j, adj)) out.println(i + " " + j);
                        else if (reachable(j, i, adj)) out.println(j + " " + i);
                        return;
                    }
                }
            }
        }

        private boolean reachable(int s, int e, Set<Integer>[] adj) {
            Set<Integer> visited = new HashSet<Integer>();
            Stack<Integer> stack = new Stack<>();
            stack.push(s);
            while (!stack.isEmpty()) {
                int element = stack.pop();
                visited.add(element);
                if (element == e) return true;
                for (int child : adj[element])
                    if (!visited.contains(child)) stack.push(child);
            }
            return false;
        }

        public static class Pair {
            int a;
            int b;

            public Pair(int x, int y) {
                a = x;
                b = y;
            }

            @Override
            public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + Math.min(a, b);
                result = prime * result + Math.max(a, b);
                return result;
            }

            @Override
            public boolean equals(Object obj) {
                Pair other = (Pair) obj;
                if (Math.min(a, b) != Math.min(other.a, other.b)) return false;
                if (Math.max(a, b) != Math.max(other.a, other.b)) return false;
                return true;
            }

        }
    }

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

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
                arr[i] = nextInt();
            return arr;
        }

    }
}


import java.util.*;
public class Main
{
    int V;
    LinkedList<Integer> adjList[];

    Main(int V)
    {
        this.V = V;
        adjList = new LinkedList[V+1];
        for(int i=1;i<=V;i++)
            adjList[i] = new LinkedList<Integer>();

    }

    public void addEdge(int src , int dest)
    {
        adjList[src].add(dest);
    }

    public void dfs(int src, boolean visited[])
    {
        visited[src] = true;
        for(Integer x: adjList[src])
        {
            if(!visited[x])
            {
                dfs(x, visited);
            }
        }
    }
    public static void main (String[] args)
    {
        /* code */
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int arr[] = new int[n+1];
        int val1 = 0;
        int val2 =0;
        long val = n*(n-1)/2-1;
        Main graph = new Main(n);
        for(int i=0;i<val;i++)
        {
            int src = scan.nextInt();
            int dest = scan.nextInt();
            arr[src]++;
            arr[dest]++;
        }
        // StringBuilder sb = new StringBuilder("");
        outer: for(int i=1;i<=n;i++)
        {
            if(arr[i]!=n-1)
            {
                val1 =i;
                for(int j=i+1;j<=n;j++)
                {
                    if(arr[j]!=n-1)
                    {
                        val2 = j;
                        break outer;
                    }
                }
            }
        }
        boolean visited[] = new boolean[n+1];
        graph.dfs(val1, visited);
        if(visited[val2])
        {
           System.out.println(val1+" "+val2);
        }
        else
        {
            System.out.println(val2+" "+val1);
        }

    }

}


import java.util.*;
public class Main
{
    int V;
    LinkedList<Integer> adjList[];

    Main(int V)
    {
        this.V = V;
        adjList = new LinkedList[V+1];
        for(int i=1;i<=V;i++)
            adjList[i] = new LinkedList<Integer>();

    }

    public void addEdge(int src , int dest)
    {
        adjList[src].add(dest);
    }

    public void dfs(int src, boolean visited[])
    {
        visited[src] = true;
        for(Integer x: adjList[src])
        {
            if(!visited[x])
            {
                dfs(x, visited);
            }
        }
    }
    public static void main (String[] args)
    {
        /* code */
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int arr[] = new int[n+1];
        int val1 = 0;
        int val2 =0;
        long val = n*(n-1)/2-1;
        Main graph = new Main(n);
        for(int i=0;i<val;i++)
        {
            int src = scan.nextInt();
            int dest = scan.nextInt();
            arr[src]++;
            arr[dest]++;
            graph.addEdge(src, dest);
        }
        // StringBuilder sb = new StringBuilder("");
        outer: for(int i=1;i<=n;i++)
        {
            if(arr[i]!=n-1)
            {
                val1 =i;
                for(int j=i+1;j<=n;j++)
                {
                    if(arr[j]!=n-1)
                    {
                        val2 = j;
                        break outer;
                    }
                }
            }
        }
        boolean visited[] = new boolean[n+1];
        graph.dfs(val1, visited);
        if(visited[val2])
        {
           System.out.println(val1+" "+val2);
        }
        else
        {
            System.out.println(val2+" "+val1);
        }

    }

}


import java.util.*;
public class Main
{
    public static void main (String[] args)
    {
        /* code */
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int arr[] = new int[n+1];
        long val = n*(n-1)/2-1;
        for(int i=0;i<val;i++)
        {
            arr[scan.nextInt()]++;
            arr[scan.nextInt()]++;
        }
        StringBuilder sb = new StringBuilder("");
        for(int i=1;i<=n;i++)
        {
            if(arr[i]!=n-1)
                sb.append(i+" ");
        }
        System.out.println(sb);

    }

}


import java.util.*;
import java.io.*;

public class  Tournament
{
	public static void main(String[] args) throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw=new PrintWriter(System.out);

		int t=1;

		while(t-->0)
		{
			int n=Integer.parseInt(br.readLine().trim());
			int a[]=new int[n+1];
			String str[];
			int c[]=new int[n+1];
			for(int i=0;i<n*(n-1)/2-1;i++)
			{
				str=br.readLine().trim().split(" ");
				a[Integer.parseInt(str[0])]++;
				a[Integer.parseInt(str[1])]++;
				c[Integer.parseInt(str[0])]++;
			}

			/*int first=0;
			for(int x:a)
				pw.print(x+" ");
			pw.println();
			for(int x:c)
				pw.print(x+" ");*/

			int ans[]=new int[2];
			int index=0;

			for(int i=1;i<n+1;i++)
			{
				if(a[i]==n-2)
					ans[index++]=i;
			}

			if(c[ans[0]]>c[ans[1]])
			{
				pw.println(ans[0]+" "+ans[1]);
			}
			else
			{
				pw.println(ans[1]+" "+ans[0]);
			}
		}
		pw.flush();
	}

}


import java.util.*;
import java.io.*;

public class  Tournament
{
	public static void main(String[] args) throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw=new PrintWriter(System.out);

		int t=1;

		while(t-->0)
		{
			int n=Integer.parseInt(br.readLine().trim());
			int a[]=new int[n+1];
			String str[];
			for(int i=0;i<n*(n-1)/2-1;i++)
			{
				str=br.readLine().trim().split(" ");
				a[Integer.parseInt(str[0])]++;
				a[Integer.parseInt(str[1])]++;
			}

			for(int i=1;i<n+1;i++)
			{
				if(a[i]==n-2)
				{
					pw.print(i+" ");
				}
			}

		}
		pw.flush();
	}

}


import java.util.*;
public class tournament
{
  public static void main(String args[])
  {
     Scanner in=new Scanner(System.in);
     int n=in.nextInt();
     int s=((n*(n-1))/2)-1;
     int a[]=new int[s];
     int b[]=new int[s];
     int c[]=new int[n+1];
     String str="";
     int i,ans=0;
     for(i=0;i<s;i++)
     {
         a[i]=in.nextInt();
         b[i]=in.nextInt();
         c[a[i]]++;
         c[b[i]]++;
        }
     for(i=0;ans<2 && i<s;i++)
     {
         if(c[a[i]]!=-1 && c[a[i]]<(n-1))
         {
             c[a[i]]=-1;
             str=str+a[i]+" ";
             ans++;
         }
         if(c[b[i]]!=-1 && c[b[i]]<(n-1))
         {
             c[b[i]]=-1;
             str=str+b[i]+" ";
             ans++;
            }
        }
     System.out.println(str.trim());
    }
}


import java.util.*;
public class tournament
{
  public static void main(String args[])
  {
     Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int c[]=new int[n];
        int d[]=new int[n];
        int i,a,b,s=n*(n-1)/2-1,x=0,y=0;
        for(i=0;i<s;i++)
        {
            a=in.nextInt();
            b=in.nextInt();
            c[a-1]++;
            c[b-1]++;
            d[a-1]++;
        }
        for(i=0;i<n;i++)
        {
            if(c[i]!=(n-1)&&x==0)
            {
                x=i+1;
            }
            else if(c[i]!=(n-1) && x!=0)
                y=i+1;
        }
        if(d[x-1]>d[y-1])
            System.out.println(x+" "+y);
        else
            System.out.println(y+" "+x);
    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;

public class Main {

    static List<Integer> [] g;
    static boolean [] v;

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                                            //(new FileReader("input.in"));
        StringBuilder out = new StringBuilder();
        StringTokenizer tk;
        Reader.init(System.in);
        //PrintWriter pw = new PrintWriter("output.out", "UTF-8");

        int n = parseInt(in.readLine());
        int i,a,b = 0;
        boolean [][] t = new boolean[n+1][n+1];

        g = new List[n+1];
        for(i=0; i<=n; i++)
            g[i] = new ArrayList<Integer>();

        for(i=0; i<n*(n-1)/2-1; i++) {
            tk = new StringTokenizer(in.readLine());
            a = parseInt(tk.nextToken());
            b = parseInt(tk.nextToken());

            g[a].add(b);
            t[a][b] = t[b][a] = true;
        }

        out:
        for(a=1; a<=n; a++)
            for(b=1; b<=n; b++)
                if(b!=a && !t[a][b])
                    break out;

        v = new boolean[n+1];
        DFS(a);

        if(v[b])
            System.out.println(a+" "+b);
        else
            System.out.println(b+" "+a);
    }

    static void DFS(int u) {
        v[u] = true;
        for(int w : g[u])
            if(!v[w])
                DFS(w);
    }
}

class pair {
    int first,second;

    public pair(int f,int s) {
        this.first = f;
        this.second = s;
    }
}

class Tools {

    public static boolean[] seive(int n) {
        boolean [] isPrime = new boolean[n+1];
        Arrays.fill(isPrime, true);

        for(int i=2; i*i<=n; i++)
            if(isPrime[i])
                for(int j=i; i*j<=n; j++)
                    isPrime[i*j] = false;

        isPrime[1] = false;

        return isPrime;
    }

    public static boolean next_permutation(int[] p, int len) {
        int a = len - 2;
        while (a >= 0 && p[a] >= p[a + 1]) {
            a--;
        }

        if (a == -1) {
            return false;
        }

        int b = len - 1;
        while (p[b] <= p[a]) {
            b--;
        }

        p[a] += p[b];
        p[b] = p[a] - p[b];
        p[a] -= p[b];

        for (int i = a + 1, j = len - 1; i < j; i++, j--) {
            p[i] += p[j];
            p[j] = p[i] - p[j];
            p[i] -= p[j];
        }

        return true;
    }

    public static int lower_bound(Comparable[] arr, Comparable key) {
        int len = arr.length;
        int lo = 0;
        int hi = len-1;
        int mid = (lo + hi)/2;
        while (true) {
            int cmp = arr[mid].compareTo(key);
            if (cmp == 0 || cmp > 0) {
                hi = mid-1;
                if (hi < lo)
                    return mid;
            } else {
                lo = mid+1;
                if (hi < lo)
                    return mid<len-1?mid+1:-1;
            }
            mid = (lo + hi)/2;
        }
    }

    public static int upper_bound(Comparable[] arr, Comparable key) {
        int len = arr.length;
        int lo = 0;
        int hi = len-1;
        int mid = (lo + hi)/2;
        while (true) {
            int cmp = arr[mid].compareTo(key);
            if (cmp == 0 || cmp < 0) {
                lo = mid+1;
                if (hi < lo)
                    return mid<len-1?mid+1:-1;
            } else {
                hi = mid-1;
                if (hi < lo)
                    return mid;
            }
            mid = (lo + hi)/2;
        }
    }

    public static int toDecimal(String s,int b) {
        int ans = 0;

        for(int i=0,j=s.length()-1; i<s.length(); i++,j--) {
            char c = s.charAt(i);
            int x = (c>='0' && c<='9' ? c-'0' : c-'A'+10);
            if(x>=b) return -1;
            ans += (c>='0' && c<='9' ? c-'0' : c-'A'+10)*(int)pow(b,j);
        }

        return ans;
    }
}

class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(
                new InputStreamReader(input, "UTF-8"));
        tokenizer = new StringTokenizer("");
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static String nextLine() throws IOException {
        return reader.readLine();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}


import java.util.*;
import java.io.*;
public class Tournament {

	@SuppressWarnings("unchecked")
	public static void main(String[] args)throws java.lang.Exception
    {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		List<Integer> a[]=new ArrayList[n+1];
		for(int i=0; i<n+1; i++) a[i]=new ArrayList<>();
		int deg[]=new int[n+1],win[]=new int[n+1], lose[]=new int[n+1];
		for(int i=0; i<(n*(n-1))/2-1; i++) {
			StringTokenizer st=new StringTokenizer(br.readLine());
			int u=Integer.parseInt(st.nextToken()),v=Integer.parseInt(st.nextToken());
			a[u].add(v);
			a[v].add(u);
			++deg[u];++deg[v];
			++win[u];++lose[v];
		}
		int p=-1,c=-1;
		for(int i=1; i<=n; i++) {
			if(deg[i]!=n-1) {p=i;break;}
		}
		Collections.sort(a[p]);
		for(int i=1; i<=n; i++) {
			if(!a[p].contains(i)) {
				if(p!=i) {c=i;break;}
			}
		}
		System.out.println(win[p]>=win[c]?(p+" "+c):(c+" "+p));
	}

}


import java.util.*;
import java.io.*;
public class Tournament {

	public static void main(String[] args)throws java.lang.Exception
    {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		List<Integer> a[]=new ArrayList[n+1];
		for(int i=0; i<n+1; i++) a[i]=new ArrayList<>();
		int deg[]=new int[n+1];
		for(int i=0; i<(n*(n-1))/2-1; i++) {
			StringTokenizer st=new StringTokenizer(br.readLine());
			int u=Integer.parseInt(st.nextToken()),v=Integer.parseInt(st.nextToken());
			a[u].add(v);
			a[v].add(u);
			++deg[u];++deg[v];
		}
		int p=0;
		for(int i=1; i<=n; i++) {
			if(deg[i]<n-1) {p=i;break;}
		}
		Collections.sort(a[p]);
		int c=0;
		for(int i=1; i<=n; i++) {
			if(!a[p].contains(i)) {
				if(p!=i) {c=i;break;}
			}
		}
		System.out.println(p+" "+c);
	}

}


import java.util.*;
import java.io.*;
public class Tournament {

	public static void main(String[] args)throws java.lang.Exception
    {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		List<Integer> a[]=new ArrayList[n+1];
		for(int i=0; i<n+1; i++) a[i]=new ArrayList<>();
		int deg[]=new int[n+1];
		for(int i=0; i<(n*(n-1))/2-1; i++) {
			StringTokenizer st=new StringTokenizer(br.readLine());
			int u=Integer.parseInt(st.nextToken()),v=Integer.parseInt(st.nextToken());
			a[u].add(v);
			a[v].add(u);
			++deg[u];++deg[v];
		}
		int p=0;
		for(int i=1; i<=n; i++) {
			if(deg[i]<n-1) {p=i;break;}
		}
		Collections.sort(a[p]);
		int c=0;
		for(int i=n; i>=1; i--) {
			if(!a[p].contains(i)) {
				if(p!=i) {c=i;break;}
			}
		}
		System.out.println(p+" "+c);
	}

}


import java.util.*;
import java.io.*;
public class Tournament {

	public static void main(String[] args)throws java.lang.Exception
    {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		List<Integer> a[]=new ArrayList[n+1];
		for(int i=0; i<n+1; i++) a[i]=new ArrayList<>();
		int deg[]=new int[n+1];
		for(int i=0; i<(n*(n-1))/2-1; i++) {
			StringTokenizer st=new StringTokenizer(br.readLine());
			int u=Integer.parseInt(st.nextToken()),v=Integer.parseInt(st.nextToken());
			a[u].add(v);
			a[v].add(u);
			++deg[u];++deg[v];
		}
		int p=0;
		for(int i=n; i>=1; i--) {
			if(deg[i]<n-1) {p=i;break;}
		}
		Collections.sort(a[p]);
		int c=0;
		for(int i=n; i>=1; i--) {
			if(!a[p].contains(i)) {
				if(p!=i) {c=i;break;}
			}
		}
		System.out.println(p+" "+c);
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
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);
        Tournament solver = new Tournament();
        solver.solve(1, in, out);
        out.close();
    }

    static class Tournament {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int games = ((n * (n - 1)) / 2) - 1;

            int won[] = new int[n + 1];
            int played[] = new int[n + 1];
            for (int i = 0; i < games; i++) {
                int x = in.nextInt();
                int y = in.nextInt();
                won[x]++;
                played[y]++;
                played[x]++;
            }

            ArrayList<Integer> arr = new ArrayList<>();

            for (int i = 1; i <= n; i++) {
                if (played[i] == n - 2) {
                    arr.add(i);
                }
            }

            int x = won[arr.get(0)];
            int y = won[arr.get(1)];

            if (x > y) {
                out.println(arr.get(0) + " " + arr.get(1));
            } else {
                out.println(arr.get(1) + " " + arr.get(0));
            }
        }

    }

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

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

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

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

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

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

        }

    }
}


import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Tournament {
	public static void main(String[]args)throws IOException{
		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(bf.readLine());
		int t=(n*(n-1))/2-1;
		boolean[][] a=new boolean[n+1][n+1];
		while(t-->0){
			String s=bf.readLine();
			String[] sa=s.split(" ");
			int x=Integer.parseInt(sa[0]);
			int y=Integer.parseInt(sa[1]);
			a[x][y]=true;
			a[y][x]=true;
		}
		boolean flag=true;
		for(int i=1;i<=n && flag;i++){
			for(int j=i+1;j<=n && flag;j++){
				if(!a[i][j]){
					System.out.println(i+" "+j);
					flag=false;
				}
			}
		}
	}
}


import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Tournament {
	public static void main(String[]args)throws IOException{
		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(bf.readLine());
		int t=(n*(n-1))/2-1;
		boolean[][] a=new boolean[n+1][n+1];
		int[] w=new int[n+1];
		while(t-->0){
			String s=bf.readLine();
			String[] sa=s.split(" ");
			int x=Integer.parseInt(sa[0]);
			int y=Integer.parseInt(sa[1]);
			a[x][y]=true;
			a[y][x]=true;
			w[x]++;
		}
		boolean flag=true;
		for(int i=1;i<=n && flag;i++){
			for(int j=i+1;j<=n && flag;j++){
				if(!a[i][j]){
					System.out.println((w[i]>w[j])? i+" "+j : j+" "+i);
					flag=false;
				}
			}
		}
	}
}


import java.util.Scanner;
import java.io.BufferedReader;
import java.io.*;
import java.io.InputStream;

public class WTF{
	public static void main(String[] args) throws Exception {

		Scanner input = new Scanner(System.in);
		int n;
		String bbbb = input.nextLine();
		String[] vvv = bbbb.split(" ");
		n=Integer.parseInt(vvv[0]);

		int [][]  arr=new int[55][55];
		for(int i=1;i<=n;i++){
			for(int j=i+1;j<=n;j++){
				arr[i][j]=0;
			}
		}

		int itr=n*(n-1)/2;
		for(int i=1;i<itr;i++){
			String s = input.nextLine();
			String[] numbers = s.split(" ");
			int x=Integer.parseInt(numbers[0]);
			int y=Integer.parseInt(numbers[1]);
			arr[x][y]=1;
			arr[y][x]=1;
		}

		int a=0,b=0;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				if(i==j) continue;
				if(arr[i][j]==0){
					a=i;
					b=j;
				}
			}
		}

		System.out.println(a+" "+b);

	}
}


import java.util.Scanner;
import java.io.BufferedReader;
import java.io.*;
import java.io.InputStream;

public class WTF{
	public static void main(String[] args) throws Exception {

		Scanner input = new Scanner(System.in);
		int n;
		String bbbb = input.nextLine();
		String[] vvv = bbbb.split(" ");
		n=Integer.parseInt(vvv[0]);

		int [][]  arr=new int[55][55];
		int [][] big=new int [55][55];
		int [][] sml=new int [55][55];

		for(int i=1;i<=n;i++){
			for(int j=i+1;j<=n;j++){
				arr[i][j]=0;
				big[i][j]=0;
				sml[i][j]=0;
			}
		}

		int itr=n*(n-1)/2;
		for(int i=1;i<itr;i++){
			String s = input.nextLine();
			String[] numbers = s.split(" ");
			int x=Integer.parseInt(numbers[0]);
			int y=Integer.parseInt(numbers[1]);
			arr[x][y]=x;
			arr[y][x]=x;
			big[x][y]=1;
			sml[y][x]=1;
		}

		int a=0,b=0;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				if(i==j) continue;
				if(arr[i][j]==0){
					a=i;
					b=j;
				}
			}
		}

		for(int i=1;i<=n;i++){
			if(big[i][b]==1 && sml[i][a]==1)
				break;
			if(sml[i][b]==1 && big[i][a]==1){
				int tmp=a;
				a=b;
				b=tmp;
			}

		}
		System.out.println(a+" "+b);

	}
}


import java.util.Scanner;
import java.io.BufferedReader;
import java.io.*;
import java.io.InputStream;

public class WTF{
	public static void main(String[] args){

		Scanner input = new Scanner(System.in);
		int n;
		String bbbb = input.nextLine();
		String[] vvv = bbbb.split(" ");
		n=Integer.parseInt(vvv[0]);

		int [][]  arr=new int[55][55];
		int [][] big=new int [55][55];
		int [][] sml=new int [55][55];

		for(int i=1;i<=n;i++){
			for(int j=i+1;j<=n;j++){
				arr[i][j]=0;
				big[i][j]=0;
				sml[i][j]=0;
			}
		}

		int itr=n*(n-1)/2;
		for(int i=1;i<itr;i++){
			String s = input.nextLine();
			String[] numbers = s.split(" ");
			int x=Integer.parseInt(numbers[0]);
			int y=Integer.parseInt(numbers[1]);
			arr[x][y]=x;
			arr[y][x]=x;
			big[x][y]=1;
			sml[y][x]=1;
		}

		int a=0,b=0;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				if(i==j) continue;
				if(arr[i][j]==0){
					a=i;
					b=j;
				}
			}
		}

		for(int i=1;i<=n;i++){
			if(big[i][b]==1 && sml[i][a]==1)
				break;
			if(sml[i][b]==1 && big[i][a]==1){
				int tmp=a;
				a=b;
				b=tmp;
			}

		}
		System.out.println(a+" "+b);

	}
}


import java.util.StringTokenizer;
import java.util.Collections;
import java.util.Collection;
import java.util.Set;
import java.util.HashSet;
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Queue;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Stack;
import java.util.Vector;
import java.util.Hashtable;
import java.util.Iterator;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileReader;

import java.math.BigInteger;

public class Main
{

	static PrintWriter writer;
	static StringTokenizer sz;
	static BufferedReader reader;

	public static void main(String[] args)
	throws Exception
	{
		declare();

		int n = readInt();
		int nMatch = n * (n - 1) / 2 ;
		int freq[] = new int[n + 1];

		for (int i=1;i < nMatch;++i)
		{
			readLine();
			++freq[readInt()];
			++freq[readInt()];
		}

		for (int i=1;i <= n;++i)
		{
			if (freq[i] != (n - 1))
				writer.print(i+" ");
		}

		close();
	}

	private static class Pair implements Comparable<Pair>
	{
		int first,second;

		public Pair(int f, int s)
		{
			first = f;
			second = s;
		}

		@Override
		public int compareTo(Main.Pair p1)
		{
			if (first == p1.first)
				return  second - p1.second;
			return first - p1.first;
		}

		@Override
		public String toString()
		{
			return first + " " + second;
		}
	}

	private static String readString()
	throws IOException
	{
		if (sz.hasMoreTokens())
			return sz.nextToken();
		return reader.readLine();
	}

	private static void readLine()
	throws IOException
	{
		sz = new StringTokenizer(reader.readLine());
	}

	private static int readInt()
	throws IOException
	{
		if (sz.hasMoreTokens())
			return Integer.parseInt(sz.nextToken());
		return Integer.parseInt(reader.readLine());
	}

	private static long readLong()
	throws IOException
	{
		if (sz.hasMoreTokens())
			return Long.parseLong(sz.nextToken());
		return Long.parseLong(reader.readLine());
	}

	private static void declare()
	{
		writer = new PrintWriter(System.out);
		reader = new BufferedReader(
			new InputStreamReader(System.in));
		sz = new StringTokenizer("");
	}

	private static void declareFile()
	throws IOException
	{
		writer = new PrintWriter("output.txt");
		reader = new BufferedReader(
			new FileReader("input.txt"));
		sz = new StringTokenizer("");
	}

	private static void close()
	throws IOException
	{
		reader.close();
		writer.flush();
		writer.close();
	}
}