import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.ObjectInputStream.GetField;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.Scanner;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

		public	class Q2 {

				static long MOD = 1000000009;
				static boolean b1,b[],bc[];
				static boolean boo[][][];
				static int ans1 = -1,ans2 = -1, root;
				static ArrayList<Integer>[] amp,amp1;
				static ArrayList<Pair>[] pmp;
				static int sum[],dist[],cnt[],ans[],size[],col[][];
				static int p = 0,cnt1 =0 ,cnt2 = 0;
				//static ArrayList<Pair3>[][][] pmp;
				static FasterScanner sc = new FasterScanner(System.in);
				static Queue<Integer> q = new LinkedList<>();
				static int arr[],start[],end[],color[],parent[];
				static PriorityQueue<Integer> pq;
				//static ArrayList<Integer> parent = new ArrayList<>();
				static LinkedList<Integer> fa;
				static BufferedWriter log;
				static TreeMap<Integer,Integer> tm = new TreeMap<>();
			//	static HashMap<Integer,Pair> hs;
				static Stack<Integer> stack = new Stack<>();
				static Pair prr[];
				static int dp[][];
				static long parent1[],parent2[],size1[],size2[],value[];
				static long Ans;
				public static void main(String[] args) throws Exception {
					/*new Thread(null, new Runnable() {
						public void run() {
							try {
								soln();
							} catch (Exception e) {
								System.out.println(e);
							}
						}
					}, "1", 1 << 26).start();*/
					soln();
			    }
				static int MAX = 1000005;
				static int n , m ,k, max, x1, x2;
				static HashSet<Integer>[] hs;
				public static void soln() throws IOException {
					//FasterScanner in = new FasterScanner(new FileInputStream("C:\\Users\\Admin\\Desktop\\QAL.txt"));
					//PrintWriter out = new PrintWriter("C:\\Users\\Admin\\Desktop\\A1.txt");
					log = new BufferedWriter(new OutputStreamWriter(System.out));
					int n = sc.nextInt();
					int temp = 0;
					HashSet<Pair> hs = new HashSet<>();
					Pair prr[] = new Pair[(n*(n-1))/2-1];
					for(int i = 0; i< (n*(n-1))/2-1; i++){
						prr[i] = new Pair(sc.nextInt(),sc.nextInt());
						hs.add(prr[i]);
						hs.add(new Pair(prr[i].v,prr[i].u));
					}
					int arr[] = new int[n+1];
					amp = (ArrayList<Integer>[]) new ArrayList[n+1];
					for(int i = 0; i<=n;i++) amp[i] = new ArrayList<>();
					parent = new int[n+1];
					for(int i = 1;i<=n;i++) parent[i] = i;
					Arrays.fill(arr, -1);
					for(Pair p:prr){
						int x = p.u, y = p.v;
						parent[y] = x;
					}
					//System.out.println(hs);
					for(int i = 1; i<= n;i++){
						for(int j = i+1;j<=n;j++){
							if(!hs.contains(new Pair(i,j))){
								int g = j;
								for(int c = 0;c<=1000000;c++){
									g = parent[g];
									if(g==i){
										System.out.println(i+" "+j);
										 return;
									}
								}
								System.out.println(j+" "+i);
							}
						}
					}
					log.close();
					//out.close();
				}
				public static class FenwickTree {
				    int[] array; // 1-indexed array, In this array We save cumulative information to perform efficient range queries and updates
				    public FenwickTree(int size) {
				        array = new int[size + 1];
				    }
				    public int rsq(int ind) {
				        assert ind > 0;
				        int sum = 0;
				        while (ind > 0) {
				            sum += array[ind];ind -= ind & (-ind);
				        }
				        return sum;
				    }
				    public int rsq(int a, int b) {
				        assert b >= a && a > 0 && b > 0;
				        return rsq(b) - rsq(a - 1);
				    }
				    public void update(int ind, int value) {
				        assert ind > 0;
				        while (ind < array.length) {
				            array[ind] += value; ind += ind & (-ind);
				        }
				    }
				    public int size() {
				        return array.length - 1;
				    }
				}
				public static void dfs(int x){
					b[x] = true;
					int max = dist[x];
					boolean v = false;
					for(int e:amp[x]){
						if(!b[e]){
							dfs(e);
							max = Math.max(max, size[e]);
						}
					}
					for(int e:amp[x]){
						v = true;
						if(size[e]==max){
							cnt[x]++;
						}
					}
					size[x] = max;
					if(!v)
					cnt[x]++;
				}
				public static void bfs(int x){
					b[x] = true;
					q = new LinkedList<Integer>();
					q.add(x);
					while(!q.isEmpty()){
						//System.out.println(q);
						int y = q.poll();
							for(int i:amp[y]){
							if(!b[i]){
								q.add(i);
								dist[i] = Math.max(dist[i], dist[y]+1);
								if(dist[i]>max){
									max = dist[i];
									k = i;
								}
								b[i]= true;
							}
						}
					}
				}
				static class Pair implements Comparable<Pair> {
					int u;
					int v;
					public Pair(){
						u = 0;
						v = 0;
					}
					public Pair(int u, int v) {
						this.u = u;
						this.v = v;
					}
					public int hashCode() {
						int hu = (int) (u ^ (u >>> 32));
						int hv = (int) (v ^ (v >>> 32));
						return 31*hu + hv;
					}

					public boolean equals(Object o) {
						Pair other = (Pair) o;
						return (u == other.u && v == other.v);
					}

					public int compareTo(Pair other) {
						return Long.compare(u, other.u) != 0 ? (Long.compare(u, other.u)) : (Long.compare(v, other.v));
					}

					public String toString() {
						return "[u=" + u + ", v=" + v + "]";
					}
				}

				public static int gcd(int n, int m){
					if(m!=0) return gcd(m,n%m);
					else return n;
				}

				static int CeilIndex(int A[], int l, int r, int key)
			    {
			        while (r - l > 1)
			        {
			            int m = l + (r - l)/2;
			            if (A[m]>=key)
			                r = m;
			            else
			                l = m;
			        }

			        return r;
			    }
			/*	public static Pair recur(int N, int K, int C){
					if(K>k) return new Pair(Long.MAX_VALUE/2,-1);
					if(N>=n && k<K) return new Pair(Long.MAX_VALUE/2,-1);
					if(N>=n && k==K) return new Pair(0,k);
					if(N>=n) return new Pair(0,0);
					if(dp[N][C][K]!=null){
						//System.out.println(dp[N][C][K]);
						return dp[N][C][K];
					}
					Pair ans = new Pair(Long.MAX_VALUE/2,-1);
					if(arr[N]>0){
						Pair p;
						if(arr[N]==C) p = recur(N+1,K,arr[N]);
						else p = recur(N+1,K+1,arr[N]);
						if((p.u)<ans.u){
							ans = p;
						}
						if(p.u==ans.u){
							if(p.v>ans.v){
								ans = p;
							}
						}
					}
					else{
					for(int i = 1 ;i <= m; i++){
						Pair p;
						if(i==C)
						p = recur(N+1,K,i);
						else p = recur(N+1,K+1,i);
						p.u+=col[N][i-1];
						if((p.u)<ans.u){
							ans = p;
						}
						if(p.u==ans.u){
							if(p.v>ans.v){
								ans = p;
							}
						}
					}
					//System.out.println(ans);
					}
					return dp[N][C][K] = ans;
				}*/
				public static void mergeSort(int[] arr2, int l ,int r){
					if((r-l)>=1){
						int mid = (l+r)/2;
						mergeSort(arr2,l,mid);
						mergeSort(arr2,mid+1,r);
						merge(arr2,l,r,mid);
						//System.out.println(Ans);
					}
				}
				public static void merge(int arr[], int l, int r, int mid){
					int n1 = (mid-l+1), n2 = (r-mid);
					int left[] = new int[n1];
					int right[] = new int[n2];
					for(int i =0 ;i<n1;i++) left[i] = arr[l+i];
					for(int i =0 ;i<n2;i++) right[i] = arr[mid+1+i];
					int i =0, j =0, k = l;
					while(i<n1 && j<n2){
						if(left[i]>right[j]){
							cnt[right[j]]+=(n1-i);
							arr[k++] = right[j++];
						}
						else{
							arr[k++] = left[i++];
						}
					}
					while(i<n1) arr[k++] = left[i++];
					while(j<n2) arr[k++] = right[j++];
				}
				public static void buildGraph(int n){
					for(int i =0;i<n;i++){
						int x = sc.nextInt(), y = sc.nextInt(), w = sc.nextInt();
						pmp[--x].add(new Pair(--y,w));
						pmp[y].add(new Pair(x,w));
					}
				}

				public static int getParent(int x){
					while(parent[x]!=x){
						parent[x] = parent[ parent[x]];
						x = parent[ x];
					}
					return x;
				}

				static int min(int a, int b, int c){
					if(a<b && a<c) return a;
					if(b<c) return b;
					return c;
				}
				private static void permutation(String prefix, String str) {
				    int n = str.length();
				    if (n == 0); //hs.add(prefix);
				    else {
				        for (int i = 0; i < n; i++)
				            permutation(prefix + str.charAt(i), str.substring(0, i) + str.substring(i+1, n));
				    }
				}
				static class Graph{
					int vertex;
					long weight;
				}
				public static void buildTree(int n){
					int arr[] = sc.nextIntArray(n);
					for(int i = 0;i<n;i++){
						int x = arr[i]-1;
						amp[i+1].add(x);
						amp[x].add(i+1);
					}
				}/*
				static class SegmentTree {
					Pair st[];
				//	long lazy[];
					SegmentTree(int n) {
						int size = 8 * n;
						st = new Pair[size];
						for(int i = 0; i< size;i++) st[i] = new Pair();
					//	lazy = new long[size];
						build(0, n - 1, 1);
					}
					Pair build(int ss, int se, int si) {
						if (ss == se) {
							st[si] = new Pair();
							if(arr[ss]==0){
								st[si].u = 1;
							}
							st[si].v = (se-ss+1)-st[si].u;
							st[si].z = 0;
							return st[si];
						}
						int mid = (ss + se) / 2;
						Pair temp1 = build(ss, mid, 2*si), temp2 = build(mid+1, se, si*2+1);
						long a1 = temp1.u+temp2.u, a2 = temp1.v+temp2.v, a3 = temp1.z+temp2.z+temp1.u*temp2.u+temp1.v*temp2.v;
						return st[si] = new Pair(a1,a2,a3);
					}

					void update(int si, int ss, int se, int idx, int val) {
						if (ss == se) {
							st[si] = new Pair();
							arr[idx] = val;
							if(arr[idx]==0){
								st[si].u = 1;
							}
							st[si].v = (se-ss+1)-st[si].u;
							st[si].z = 0;
						}
						else {
							int mid = (ss + se) / 2;
							if(ss <= idx && idx <= mid)
					        {
					             update(2*si, ss, mid, idx, val);
					        }
					        else
					        { update(2*si+1, mid+1, se, idx, val);
					        }
							long a1 = st[si*2].u+st[si*2+1].u, a2 = st[si*2].v+st[si*2+1].v, a3 = st[si*2].z+st[si*2+1].z+st[si*2+1].u*st[si*2].u+st[si*2+1].v*st[si*2].v;
							st[si] = new Pair(a1,a2,a3);
						}
					}
					Pair get(int qs, int qe, int ss, int se, int si){
						if(qs>se || qe<ss){
							return new Pair(0,0,0);
						}
						if (qs <= ss && qe >= se) {
							return st[si];
						}
						int mid = (ss+se)/2;
						Pair temp1 = get(qs, qe, ss, mid, si * 2), temp2 = get(qs, qe, mid + 1, se, si * 2 + 1);
						long a1 = temp1.u+temp2.u, a2 = temp1.v+temp2.v, a3 = temp1.z+temp2.z+temp1.u*temp2.u+temp1.v*temp2.v;
						st[si] = new Pair(a1,a2,a3);
						return st[si];
					}
					/*void updateRange(int node, int start, int end, int l, int r, long val)
					{
					    if(lazy[node] != 0)
					    {
					        // This node needs to be updated
					        st[node] += (end - start + 1) * lazy[node];    // Update it
					        if(start != end)
					        {
					            lazy[node*2] += lazy[node];                  // Mark child as lazy
					            lazy[node*2+1] += lazy[node];                // Mark child as lazy
					        }
					        lazy[node] = 0;                                  // Reset it
					    }
					    if(start > end || start > r || end < l)              // Current segment is not within range [l, r]
					        return;
					    if(start >= l && end <= r)
					    {
					        // Segment is fully within range
					        st[node] += (end - start + 1) * val;
					        if(start != end)
					        {
					            // Not leaf node
					            lazy[node*2] += val;
					            lazy[node*2+1] += val;
					        }
					        return;
					    }
					    int mid = (start + end) / 2;
					    updateRange(node*2, start, mid, l, r, val);        // Updating left child
					    updateRange(node*2 + 1, mid + 1, end, l, r, val);   // Updating right child
					    st[node] = st[node*2] + st[node*2+1];        // Updating root with max value
					}

					long queryRange(int node, int start, int end, int l, int r)
					{
					    if(start > end || start > r || end < l)
					        return 0L;         // Out of range
					    if(lazy[node] != 0)
					    {
					        // This node needs to be updated
					        st[node] += (end - start + 1) * lazy[node];            // Update it
					        if(start != end)
					        {
					            lazy[node*2] += lazy[node];         // Mark child as lazy
					            lazy[node*2+1] += lazy[node];    // Mark child as lazy
					        }
					        lazy[node] = 0L;                 // Reset it
					    }
					    if(start >= l && end <= r)             // Current segment is totally within range [l, r]
					        return  st[node];
					    int mid = (start + end) / 2;
					    long p1 = queryRange(node*2, start, mid, l, r);         // Query left child
					    long p2 = queryRange(node*2 + 1, mid + 1, end, l, r); // Query right child
					    return (p1 + p2);
					}
					void print() {
						for (int i = 0; i < st.length; i++) {
							System.out.print(st[i].u+" "+st[i].v+" "+st[i].z+"\n");
						}
						System.out.println();
					}
				}*/
				static class Tree {
					ArrayList<Integer>[] g ;
					int T[]; // parent
					int L[]; // level
					int P[][]; // P[i][j] = 2^j th parent of i

					public Tree(int n) {
						T = new int[n];
						L = new int[n];
						P = new int[n][log2(n) + 1];
						g = (ArrayList<Integer>[])new ArrayList[n];
						L[0] = 0;
						T[0] = -1;
						for (int i = 0; i < n; i++) {
							g[i] = new ArrayList<>();
						}
						for (int i = 0; i < n ; i++) {
							int a = sc.nextInt();
							for(int j = 0; j<a; j++){
								int b = sc.nextInt()-1;
								g[i].add(b);
								g[b].add(i);
							}
						}
						dfs(0, -1);
						for (int j = 0; (1 << j) <= n; j++)
							pre(0, j,-1);
					}

					public int log2(int n) {
						return (int) (Math.log10(n) / Math.log10(2));
					}

					public void dfs(int node, int p) {
						for (int k : g[node]) {
							if (k != p) {
								T[k] = node;
								L[k] = L[node] + 1;
								dfs(k, node);
							}
						}
					}
					public void pre(int node, int j,int p) {
						if (j == 0) {
							P[node][j] = T[node];
						} else {
							P[node][j] = P[P[node][j - 1]][j - 1];
						}
						for (int k : g[node]) {
							if(k!=p)
								pre(k, j,node);
						}
					}
					public int lca(int u, int v) {
						if (L[u] > L[v]) {
							int temp = u;
							u = v;
							v = temp;
						}
						int log;
						for (log = 0; (1 << log) <= L[v]; log++)
							; // convert level into log
						log--;

						for (int i = log; i >= 0; i--) {
							if ((1 << i) <= L[v] - L[u]) // make both node's level same
								v = P[v][i];
						}
						if (u == v)
							return u;
						for (int i = log; i >= 0; i--) {
							if (P[u][i] != -1 && P[u][i] != P[v][i]) // shift up both u and v
							{
								u = P[u][i];
								v = P[v][i];
							}
						}
						return T[u];
					}
				}
				public static long max(long x, long y, long z){
					if(x>=y && x>=z) return x;
					if(y>=x && y>=z) return y;
					return z;
				}

				public static void seive(long n){
					b = new boolean[(int) (n+1)];
					Arrays.fill(b, true);
					for(int i = 2;i*i<=n;i++){
						if(b[i]){
							for(int p = 2*i;p<=n;p+=i){
								b[p] = false;
							}
						}
					}
				}
				static long modInverse(long a, long mOD2){
				            return  power(a, mOD2-2, mOD2);
				}
				static long power(long x, long y, long m)
				{
				    if (y == 0)
				        return 1;
				    long p = power(x, y/2, m) % m;
				    p = (p * p) % m;

				    return (y%2 == 0)? p : (x * p) % m;
				}
				static long d,x,y;
				public static void extendedEuclidian(long a, long b){
					if(b == 0) {
				        d = a;
				        x = 1;
				        y = 0;
				    }
				    else {
				        extendedEuclidian(b, a%b);
				        int temp = (int) x;
				        x = y;
				        y = temp - (a/b)*y;
				    }
				}

				static class FasterScanner {

					private final InputStream stream;
					private final byte[] buf = new byte[8192];
					private int curChar, snumChars;
					private SpaceCharFilter filter;
					public int read() {
						if (snumChars == -1)
							throw new InputMismatchException();
						if (curChar >= snumChars) {
							curChar = 0;
							try {
								snumChars = System.in.read(buf);
							} catch (IOException e) {
								throw new InputMismatchException();
							}
							if (snumChars <= 0)
								return -1;
						}
						return buf[curChar++];
					}
					public FasterScanner(InputStream stream) {
						this.stream = stream;
					}
					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 int snext() {
						if (snumChars == -1)
							throw new InputMismatchException();
						if (curChar >= snumChars) {
							curChar = 0;
							try {
								snumChars = stream.read(buf);
							} catch (IOException e) {
								throw new InputMismatchException();
							}
							if (snumChars <= 0)
								return -1;
						}
						return buf[curChar++];
					}

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

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

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

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

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

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

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

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

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


//package contest_27;

import java.util.ArrayList;
import java.util.Scanner;

public class B_tournament {
    public static void main(String[] args) {
        Scanner sanat = new Scanner(System.in);
        int n = sanat.nextInt();
        boolean [][]used = new boolean[n+1][n+1];
        ArrayList<Integer> []al = new ArrayList[n+1];
        for (int i = 1; i <= n; i++) {
            al[i] = new ArrayList<Integer>();
        }
        for (int i = 1; i <= (n*(n-1))/2-1; i++) {
            int x = sanat.nextInt(), y = sanat.nextInt();
            used[x][y]=used[y][x]=true;
            al[x].add(y);
        }
        for (int i = 1; i <= n; i++) {
            if(!al[i].isEmpty()){
                Object[]tmp = al[i].toArray();
                for (int j = 0; j < tmp.length; j++) {
                    al[i].addAll(al[(Integer) tmp[j]]);
                }
            }
//          System.out.println(i+" "+al[i]);
//          System.out.println("-----------");
        }
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
//              System.out.println(i+" "+j+" "+used[i][j]);
                if(i!=j && !used[i][j]){
                    if(al[i].contains(j)){
                        System.out.println(i+" "+j);
                        return;
                    }
                    if(al[j].contains(i)){
                        System.out.println(j+" "+i);
                        return;
                    }
                }
            }
        }
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                if(!used[i][j] && i!=j){
                    System.out.println(i+" "+j);
                    return;
                }
            }
        }   }
}


//package contest_27;

import java.util.ArrayList;
import java.util.Scanner;

public class B_tournament {
    public static void main(String[] args) {
        Scanner sanat = new Scanner(System.in);
        int n = sanat.nextInt();
        boolean [][]used = new boolean[n+1][n+1];
        ArrayList<Integer> []al = new ArrayList[n+1];
        for (int i = 1; i <= n; i++) {
            al[i] = new ArrayList<Integer>();
        }
        for (int i = 1; i <= (n*(n-1))/2-1; i++) {
            int x = sanat.nextInt(), y = sanat.nextInt();
            used[x][y]=used[y][x]=true;
            al[x].add(y);
        }
        for (int i = 1; i <= n; i++) {
            if(!al[i].isEmpty()){
                Object[]tmp = al[i].toArray();
                for (int j = 0; j < tmp.length; j++) {
                    al[i].addAll(al[(Integer) tmp[j]]);
                }
            }
//          System.out.println(i+" "+al[i]);
//          System.out.println("-----------");
        }
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                if(i!=j && !used[i][j]){
                    if(al[i].contains(j)){
                        System.out.println(i+" "+j);
                        return;
                    }
                    if(al[j].contains(i)){
                        System.out.println(j+" "+i);
                        return;
                    }
                }
            }
        }
    }
}


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

public class code {

    static List<Integer>[] g;
    static boolean[] vis;
    public static void main(String[] args){

        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        g = new List[n+1];
        vis = new boolean[n+1];

        for (int i = 1; i < n*(n-1)/2; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            if(g[x] == null){
                g[x] = new LinkedList<>();
            }
            g[x].add(y);
        }

        int xx = 0, yy = 0;

        OUTER: for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                if(i==j)
                    continue;

                if(Objects.isNull(g[i]))
                    continue;

                if(!g[i].contains(j)
                        && (Objects.isNull(g[j])||!g[j].contains(i))){
                    xx = i;
                    yy = j;
                    break OUTER;
                }
            }
        }

        if(findPath(xx, yy)){
            out.println(xx+" "+yy);
        }
        else{
            out.println(yy+" "+xx);
        }

        out.close();
    }

    static boolean findPath(int x, int y){
        vis[x] = true;
        if(Objects.isNull(g[x]))return false;
        if(g[x].contains(y))
            return true;

        for (int child: g[x]) {
            if(!vis[child]&&findPath(child, y)){
                return true;
            }
        }
        return false;
    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {

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

        public FastReader(File file) throws FileNotFoundException {

            br = new BufferedReader(
                    new FileReader(file));
        }

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

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}


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

public class code {

    static List<Integer>[] g;
    static boolean[] vis;
    public static void main(String[] args){

        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        g = new List[n+1];
        vis = new boolean[n+1];

        for (int i = 1; i < n*(n-1)/2; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            if(g[x] == null){
                g[x] = new LinkedList<>();
            }
            g[x].add(y);
        }

        int xx = 0, yy = 0;

        OUTER: for (int i = 1; i <= n; i++) {
            if(Objects.isNull(g[i])){
                if(xx == 0) {
                    xx = i;
                }
                continue;
            }

            for (int j = 1; j <= n; j++) {
                if(i == j)
                    continue;

                if(Objects.isNull(g[j]) && xx != 0 && j!=xx){
                    yy = j;
                    break OUTER;
                }

                if(!g[i].contains(j)
                    && (Objects.isNull(g[j])||!g[j].contains(i))){
                    xx = i;
                    yy = j;
                    break OUTER;
                }
            }
        }

        if(findPath(xx, yy)){
            out.println(xx+" "+yy);
        }
        else{
            out.println(yy+" "+xx);
        }

        out.close();
    }

    static boolean findPath(int x, int y){
        vis[x] = true;
        if(Objects.isNull(g[x]))return false;
        if(g[x].contains(y))
            return true;

        for (int child: g[x]) {
            if(!vis[child]&&findPath(child, y)){
                return true;
            }
        }
        return false;
    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {

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

        public FastReader(File file) throws FileNotFoundException {

            br = new BufferedReader(
                    new FileReader(file));
        }

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

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}


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

public class code {

    static List<Integer>[] g;
    static boolean[] vis;
    public static void main(String[] args){

        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        g = new List[n+1];
        vis = new boolean[n+1];

        for (int i = 1; i < n*(n-1)/2; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            if(g[x] == null){
                g[x] = new LinkedList<>();
            }
            g[x].add(y);
        }

        int xx = 0, yy = 0;

        OUTER: for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                if(i==j)
                    continue;

                if(Objects.isNull(g[i]))
                    continue;

                if(!g[i].contains(j)
                        && (Objects.isNull(g[j])||!g[j].contains(i))){
                    xx = i;
                    yy = j;
                    break OUTER;
                }
            }
        }

        if(findPath(xx, yy)){
            out.println(xx+" "+yy);
        }
        else{
            out.println(yy+" "+xx);
        }

        out.close();
    }

    static boolean findPath(int x, int y){
        vis[x] = true;
        if(Objects.isNull(g[x]))return false;
        if(g[x].contains(y))
            return true;

        for (int child: g[x]) {
            if(!vis[x]&&findPath(child, y)){
                return true;
            }
        }
        return false;
    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {

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

        public FastReader(File file) throws FileNotFoundException {

            br = new BufferedReader(
                    new FileReader(file));
        }

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

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}


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

public class code {

    static List<Integer>[] g;
    public static void main(String[] args){

        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(System.out);

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

        for (int i = 1; i < n*(n-1)/2; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            if(g[x] == null){
                g[x] = new LinkedList<>();
            }
            g[x].add(y);
        }

        int xx = 0, yy = 0;

        OUTER: for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                if(i==j)
                    continue;

                if(Objects.isNull(g[i]))
                    continue;

                if(!g[i].contains(j)
                        && (Objects.isNull(g[j])||!g[j].contains(i))){
                    xx = i;
                    yy = j;
                    break OUTER;
                }
            }
        }

        if(findPath(xx, yy)){
            out.println(xx+" "+yy);
        }
        else{
            out.println(yy+" "+xx);
        }

        out.close();
    }

    static boolean findPath(int x, int y){
        if(Objects.isNull(g[x]))return false;
        if(g[x].contains(y))
            return true;

        for (int child: g[x]) {
            if(findPath(child, y)){
                return true;
            }
        }
        return false;
    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {

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

        public FastReader(File file) throws FileNotFoundException {

            br = new BufferedReader(
                    new FileReader(file));
        }

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

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}


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

public class code {

    static List<Integer>[] g;
    public static void main(String[] args){

        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(System.out);

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

        for (int i = 1; i < n*(n-1)/2; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            if(g[x] == null){
                g[x] = new LinkedList<>();
            }
            g[x].add(y);
        }

        int xx = 0, yy = 0;

        OUTER: for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                if(i==j)continue;
                if(Objects.nonNull(g[i]) && !g[i].contains(j)
                        && Objects.nonNull(g[j])&& !g[j].contains(i)){
                    xx = i;
                    yy = j;
                    break OUTER;
                }
            }
        }

        if(findPath(xx, yy)){
            out.println(xx+" "+yy);
        }
        else{
            out.println(yy+" "+xx);
        }

        out.close();
    }

    static boolean findPath(int x, int y){
        if(Objects.isNull(g[x]))return false;
        if(g[x].contains(y))
            return true;

        for (int child: g[x]) {
            if(findPath(child, y)){
                return true;
            }
        }
        return false;
    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {

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

        public FastReader(File file) throws FileNotFoundException {

            br = new BufferedReader(
                    new FileReader(file));
        }

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

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}


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

public class code {

    static List<Integer>[] g;
    static boolean[] vis;
    public static void main(String[] args){

        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        g = new List[n+1];
        vis = new boolean[n+1];

        for (int i = 1; i < n*(n-1)/2; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            if(g[x] == null){
                g[x] = new LinkedList<>();
            }
            g[x].add(y);
        }

        int xx = 0, yy = 0;

        OUTER: for (int i = 1; i <= n; i++) {
            if(Objects.isNull(g[i])&&xx == 0){
                xx = i;
                continue;
            }

            for (int j = 1; j <= n; j++) {
                if(i == j)
                    continue;

                if(Objects.isNull(g[j]) && xx != 0 && j!=xx){
                    yy = j;
                    break OUTER;
                }

                if(!g[i].contains(j)
                    && (Objects.isNull(g[j])||!g[j].contains(i))){
                    xx = i;
                    yy = j;
                    break OUTER;
                }
            }
        }

        if(findPath(xx, yy)){
            out.println(xx+" "+yy);
        }
        else{
            out.println(yy+" "+xx);
        }

        out.close();
    }

    static boolean findPath(int x, int y){
        vis[x] = true;
        if(Objects.isNull(g[x]))return false;
        if(g[x].contains(y))
            return true;

        for (int child: g[x]) {
            if(!vis[child]&&findPath(child, y)){
                return true;
            }
        }
        return false;
    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {

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

        public FastReader(File file) throws FileNotFoundException {

            br = new BufferedReader(
                    new FileReader(file));
        }

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

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}


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

public class B27 {

	public static BufferedReader read = null;
	public static PrintWriter out = null;
	public static StringTokenizer token = null;

	public static void solve()
	{
		int n = nint();
		int[] played = new int[n+1];
		int[] won = new int[n+1];
		for(int i=1; i<= (n*(n-1))/2 -1 ;i++)
		{
			int x = nint(), y = nint();
			played[x]++;
			played[y]++;
			won[x]++;
		}
		int u = 0, v = 0;
		for(int i=1; i<=n; i++)
		{
			if(played[i] == n-2)
			{
				if(u == 0)
				{
					u = i;
				}
				else
				{
					v = i;
				}
			}
		}
		if(won[u] >= won[v])
		{
			out.println(u + " " + v) ;
		}
		else
		{
			out.println(v + " " + u);
		}
	}

	public static void main(String[] args)
	{
		read = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.flush();
		out.close();

	}

	// i/o functions
	public static String next() // returns the next string
	{
		while(token == null || !token.hasMoreTokens())
		{
			try {
				token = new StringTokenizer(read.readLine());
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return token.nextToken();
	}

	public static int nint()
	{
		return Integer.parseInt(next());
	}
	public static long nlong()
	{
		return Long.parseLong(next());
	}
	public static double ndouble()
	{
		return Double.parseDouble(next());
	}
	public static int[] narr(int n)
	{
		int[] a = new int[n];
		for(int i=0; i<n; i++) a[i] = nint();
		return a;
	}

	public static long[] nal(int n)
	{
		long[] a = new long[n];
		for(int i=0; i<n; i++) a[i] = nlong();
		return a;
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int countOfPlayres = in.nextInt();
        int[][] leaderBoard = new int[countOfPlayres + 1][countOfPlayres + 1];
        int countOfGames = (int) countOfPlayres*(countOfPlayres - 1) / 2 - 1;

        for (int i = 0; i < countOfGames; i++){
            int firstPlayer = in.nextInt();
            int secondPlayer = in.nextInt();
            leaderBoard[firstPlayer][secondPlayer] = 1;
            leaderBoard[secondPlayer][firstPlayer] = -1;
        }

//        for (int i = 1; i <= countOfPlayres; i++){
//            for (int j = 1; j <= countOfPlayres; j++){
//                System.out.print(leaderBoard[i][j] + " ");
//            }
//            System.out.println();
//        }

        boolean q = false;
        int firstNotPlayed = 0;
        int secondNotPlayed = 0;
        for (int i = 1; i <= countOfPlayres; i++){
            int k = 0;
            for (int j = 1; j <= countOfPlayres; j++){
                if (leaderBoard[i][j] != 0){
                    k++;
                }
            }
            if ((k != countOfPlayres - 1) && (!q)){
                firstNotPlayed = i;
                q = true;
            }
            else if ((k != countOfPlayres - 1) && (q)){
                secondNotPlayed = i;
                break;
            }
        }

        if (Arrays.equals(leaderBoard[firstNotPlayed], leaderBoard[secondNotPlayed])){
            System.out.println(firstNotPlayed + " " + secondNotPlayed);
        }
        else {
            for (int i = 1; i <= countOfPlayres; i++) {
                if (leaderBoard[firstNotPlayed][i] > leaderBoard[secondNotPlayed][i]) {
                    System.out.println(firstNotPlayed + " " + secondNotPlayed);
                    break;
                } else if (leaderBoard[firstNotPlayed][i] < leaderBoard[secondNotPlayed][i]) {
                    System.out.println(secondNotPlayed + " " + firstNotPlayed);
                    break;
                }
            }
        }
    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int countOfPlayres = in.nextInt();
        int[][] leaderBoard = new int[countOfPlayres + 1][countOfPlayres + 1];
        int countOfGames = (int) countOfPlayres*(countOfPlayres - 1) / 2 - 1;

        for (int i = 0; i < countOfGames; i++){
            int firstPlayer = in.nextInt();
            int secondPlayer = in.nextInt();
            leaderBoard[firstPlayer][secondPlayer] = 1;
            leaderBoard[secondPlayer][firstPlayer] = -1;
        }

        boolean q = false;
        int firstNotPlayed = 0;
        int secondNotPlayed = 0;
        for (int i = 1; i <= countOfPlayres; i++){
            int k = 0;
            for (int j = 1; j <= countOfPlayres; j++){
                if (leaderBoard[i][j] != 0){
                    k++;
                }
            }
            if ((k != countOfPlayres - 1) && (!q)){
                firstNotPlayed = i;
                q = true;
            }
            else if ((k != countOfPlayres - 1) && (q)){
                secondNotPlayed = i;
                break;
            }
        }

        for (int i = 1; i <= countOfPlayres; i++){
            if (leaderBoard[firstNotPlayed][i] > leaderBoard[secondNotPlayed][i]){
                System.out.println(firstNotPlayed + " " + secondNotPlayed);
                break;
            }
            else if (leaderBoard[firstNotPlayed][i] < leaderBoard[secondNotPlayed][i]){
                System.out.println(secondNotPlayed + " " + firstNotPlayed);
                break;
            }
        }
    }
}


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

/**
 *
 * @author mohanad
 */
public class Div2_27B {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(bf.readLine());
        boolean arr[][]=new boolean[n+1][n+1];
        int regin = n*(n-1)/2-1;
        for (int i = 0 ; i < regin ; ++i){
            String xy[]=bf.readLine().split(" ");
            int x=Integer.parseInt(xy[0]);
            int y=Integer.parseInt(xy[1]);
            arr[x][y]=true;
            arr[y][x]=true;
        }

        for (int i = 1 ; i <=n ; ++i)
            for (int j=1 ; j <=n ; ++j){
                if (!arr[i][j] && i!=j){
                    System.out.println(i+" "+j);
                    return;
                }
            }

    }

}


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

/**
 *
 * @author mohanad
 */
public class Div2_27B {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(bf.readLine());
        boolean arr[][]=new boolean[n+1][n+1];
        int regin = n*(n-1)/2-1;
        int winers[] = new int [n+1];
        for (int i = 0 ; i < regin ; ++i){
            String xy[]=bf.readLine().split(" ");
            int x=Integer.parseInt(xy[0]);
            int y=Integer.parseInt(xy[1]);
            arr[x][y]=true;
            arr[y][x]=true;
            winers[x]++;
        }

        for (int i = 1 ; i <=n ; ++i)
            for (int j=1 ; j <=n ; ++j){
                if (!arr[i][j] && i!=j){
                    System.out.println(winers[i]>winers[j]?i+" "+j:j+" "+i);
                    return;
                }
            }

    }

}


import java.util.Scanner;

public class Tourment {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int[] p = new int[n];
		int[] g = new int[n];
		for(int i=1; i<n*(n-1)/2;i++){
			int x = input.nextInt()-1;
			int y = input.nextInt()-1;
			p[x]++;
			g[x]++;
			g[y]++;
		}
		int a=-1;
		int b=-1;
		for(int i=0; i<n;i++){
			if(g[i]!=n-1){
				if(a==-1){
					a =i;

				}
				else{
					b = i;
					break;
				}
			}
		}
		if(p[a]>p[b])System.out.println((a+1) + " " + (b+1));
		else
			System.out.println((b+1)+ " " + (a+1));

	}

}


import java.util.*;
import java.io.*;
import java.math.*;
import java.text.*;
public class Main
{
    static class Reader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.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 s(){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 l(){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 i(){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 double d() throws IOException {return Double.parseDouble(s()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
        public int[] arr(int n){int[] ret = new int[n];for (int i = 0; i < n; i++) {ret[i] = i();}return ret;}
    }

           //       |----|       /\      |    |   -----   |
           //       |   /       /  \     |    |     |     |
           //       |--/       /----\    |----|     |     |
           //       |   \     /      \   |    |     |     |
           //       |    \   /        \  |    |   -----   -------

    public static void main(String args[])throws IOException
    {
        PrintWriter out=new PrintWriter(System.out);
        Reader sc=new Reader();
        int n=sc.i();
        int arr[][]=new int[(n*(n-1))/2-1][2];
        for(int i=0;i<arr.length;i++)
        arr[i]=sc.arr(2);
        int win[]=new int[n+1];
        int loss[]=new int[n+1];
        for(int i=0;i<arr.length;i++)
        {
            win[arr[i][0]]++;
            loss[arr[i][1]]++;
        }
        ArrayList<Integer> al=new ArrayList<>();
        for(int i=1;i<=n;i++)
            if(win[i]+loss[i]!=n-1)
            al.add(i);
        if(loss[al.get(0)]<loss[al.get(1)])
        out.println(al.get(0)+" "+al.get(1));
        else
        out.println(al.get(1)+" "+al.get(0));

        out.flush();
    }
}


import java.util.Scanner;
import java.math.*;
import java.lang.*;
import java.io.*;
public class Main{
	public static void  main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[] a = new int[55];
		int[] b = new int[5];
		int[] win = new int[55];
		int n = scan.nextInt();
		int m = n*(n-1)/2-1;
		for(int i=1;i<=m; i++) {
			int x = scan.nextInt();
			int y = scan.nextInt();
			a[x]++; a[y]++;
			win[x]++;
		}
		int tot = 0;
		for(int i=1;i<=n;i++) {
			if(a[i] != (n-1)) b[++tot] = i;
		}
	//	System.out.println(tot);
	//	System.out.println(b[1]+" "+b[2]);
		if(win[b[1]] > win[b[2]]) {
			System.out.println(b[1]+" "+b[2]);
		}else {
			System.out.println(b[2]+" "+b[1]);
		}
	}
}


import java.util.*;
import java.io.*;
import static java.lang.System.in;

public class Main {
    static int n,maxn;
    static long mod = 1000000000+7;
    static HashSet<Integer>[] graph;
    public static void main(String[] args)throws IOException {
        //BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        Scanner sc = new Scanner(System.in);
        //String[] buf = reader.readLine().split(" ");
        n = sc.nextInt();
        int[] win = new int[n+1], loss = new int[n+1];
        for(int i=n*(n-1)/2-1;i>0;i--){
            int a = sc.nextInt(), b = sc.nextInt();
            win[a]++; loss[b]++;
        }
        ArrayList<Integer> can = new ArrayList<>();
        for(int i=1;i<=n;i++){
            if(win[i]+loss[i]!=n-1) can.add(i);
        }
        int can1 = can.get(0), can2 = can.get(1);
        if(win[can1]<win[can2]){
            int c = can1;
            can1 = can2; can2 = c;
        }
        System.out.println(String.format("%d %d",can1,can2));
    }
}


#include <bits/stdc++.h>

using namespace std;

long long n,c,j,w,i,a[1000000],s,b,t,d,ans,z,x;
int main()
{

//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    cin>>n>>t>>c;
    for(i=0;i<n;i++){cin>>x;if(x>t)z++;}
    ans=(n-c+1)-z*c;
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long n,c,j,w,i,a[1000000],s,b,t,d,ans,z;
int main()
{

//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    cin>>n>>t>>c;
    for(i=0;i<n;i++)cin>>a[i];
    for(i=0;i<=n-c;i++)
    {
    for(j=i;j<c+i;j++)if(a[j]>t)z=1,i=j;
    if(z!=1)ans++;
    z=0;
    }
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define pb push_back

void solve()
{
    ll n, t, c, cnt(0);
    cin >> n >> t >> c;

    ll a[n];

    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }

    for (int i = 0; i <= n - c; i++)
    {
        if (a[i] <= t)
        {
            for (int j = i + 1; j < i + c; j++)
            {
                if (a[j] > t)
                {
                    break;
                }

                if (j == i + c - 1)
                {
                    cnt++;
                }
            }
        }
    }

    cout << cnt << endl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(8);
    ll t(1);
    //    cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define pb push_back

void solve()
{
    ll n, t, c, cnt(0);
    cin >> n >> t >> c;

    ll a[n];
    vector<ll> v;

    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }

    ll curr = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] <= t)
        {
            curr++;
        }
        else
        {
            v.pb(curr);
            curr = 0;
        }
    }

    v.pb(curr);

    for (int i = 0; i < v.size(); i++)
    {
        cnt += v[i] - c + 1;
    }

    if (cnt < 0)
    {
        cout << 0 << endl;
    }
    else
    {
        cout << cnt << endl;
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(8);
    ll t(1);
    //    cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define pb push_back

void solve()
{
    ll n, t, c, cnt(0);
    cin >> n >> t >> c;

    ll a[n];
    vector<ll> v;

    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }

    ll curr = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] <= t)
        {
            curr++;
        }
        else
        {
            v.pb(curr);
            curr = 0;
        }
    }

    v.pb(curr);

    for (int i = 0; i < v.size(); i++)
    {
        if (v[i] != 0)
        {
            cnt += v[i] - c + 1;
        }
    }

    cout << cnt << endl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(8);
    ll t(1);
    //    cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define pb push_back

void solve()
{
    ll n, t, c, cnt(0);
    cin >> n >> t >> c;

    ll a[n];
    vector<ll> v;

    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }

    ll curr = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] <= t)
        {
            curr++;
        }
        else
        {
            v.pb(curr);
            curr = 0;
        }
    }

    v.pb(curr);

    for (int i = 0; i < v.size(); i++)
    {
        if (v[i] != 0 && curr >= c)
        {
            cnt += v[i] - c + 1;
        }
    }

    cout << cnt << endl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(8);
    ll t(1);
    //    cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define pb push_back

void solve()
{
    ll n, t, c, cnt(0);
    cin >> n >> t >> c;

    ll a[n];
    vector<ll> v;

    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }

    ll curr = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] <= t)
        {
            curr++;
        }
        else
        {
            if (curr >= c)
            {
                v.pb(curr);
            }
            curr = 0;
        }
    }

    if (curr >= c)
    {
        v.pb(curr);
    }

    for (int i = 0; i < v.size(); i++)
    {

        cnt += v[i] - c + 1;
    }

    cout << cnt << endl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(8);
    ll t(1);
    //    cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define pb push_back

void solve()
{
    ll n, t, c, cnt(0);
    cin >> n >> t >> c;

    ll a[n];
    vector<ll> v;

    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }

    ll curr = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] <= t)
        {
            curr++;
        }
        else
        {
            if (curr >= c)
            {
                v.pb(curr);
            }
            curr = 0;
        }
    }

    v.pb(curr);

    for (int i = 0; i < v.size(); i++)
    {

        cnt += v[i] - c + 1;
    }

    cout << cnt << endl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(8);
    ll t(1);
    //    cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define pb push_back

void solve()
{
    ll n, t, c, cnt(0);
    cin >> n >> t >> c;

    ll a[n];
    vector<ll> v;

    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }

    ll curr = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] <= t)
        {
            curr++;
        }
        else
        {
            v.pb(curr);
            curr = 0;
        }
    }

    v.pb(curr);

    for (int i = 0; i < v.size(); i++)
    {
        cnt += v[i] - c + 1;
    }

    cout << cnt << endl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(8);
    ll t(1);
    //    cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n, t, c;

    cin >> n >> t >> c;

    int tab[n+1];

    for(int i = 1; i <= n; i++)
        cin >> tab[i];

    int licznik = 0;
    int wynik = 0;

    for(int i = 1; i <= n; i++)
    {
        if(tab[i]<=t)
            licznik++;
        else
        {
            if(licznik>=c)
            {
                wynik+=(licznik-c+1);
                licznik = 0;
            }

        }
    }

    if(licznik>=c)
        wynik+=(licznik-c+1);
    cout << wynik << "\n";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n, t, c;

    cin >> n >> t >> c;

    int tab[n+1];

    for(int i = 1; i <= n; i++)
        cin >> tab[i];

    int licznik = 0;
    int wynik = 0;

    for(int i = 1; i <= n; i++)
    {
        //cout << tab[i] << " ";

        if(tab[i]>t)
        {
            licznik = 0;
            if(c>1)
            {
                i+=c;
                i-=2;
            }

            if(c==1)
            {
                i+=c;
                i--;
            }

            continue;
            cout << "huj";
        }

        licznik++;
        if(licznik==c)
        {
            wynik++;
            licznik = 0;
            i-=c;
            i++;
            //cout << "\n";
        }
    }

    //cout << "\n";
    cout << wynik << "\n";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n, t, c;

    cin >> n >> t >> c;

    int tab[n+1];

    for(int i = 1; i <= n; i++)
        cin >> tab[i];

    int licznik = 0;
    int wynik = 0;

    for(int i = 1; i <= n; i++)
    {
        if(tab[i]<=t)
            licznik++;
        else
        {
            if(licznik>=c)
            {
                wynik+=(licznik-c+1);

            }
            licznik = 0;
        }
    }

    if(licznik>=c)
        wynik+=(licznik-c+1);
    cout << wynik << "\n";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n, t, c;

    cin >> n >> t >> c;

    int tab[n+1];

    for(int i = 1; i <= n; i++)
        cin >> tab[i];

    int licznik = 0;
    int wynik = 0;

    for(int i = 1; i <= n; i++)
    {
        //cout << tab[i] << " ";

        if(tab[i]>t)
        {
            licznik = 0;
            i+=c;
            i-=2;
            continue;
        }

        licznik++;
        if(licznik==c)
        {
            wynik++;
            licznik = 0;
            i-=c;
            i++;
            //cout << "\n";
        }
    }

    //cout << "\n";
    cout << wynik << "\n";

    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define lld long long int
int main()
{
    fast;
    long int n,c;
    lld t;
    cin>>n>>t>>c;
    vector<lld> v(n);
    for(long int i=0;i<n ;i++)
        cin>>v[i];
    lld ans=0,cnt=0;
    for(long int i=0;i<n;i++)
    {
        if(v[i]<=t)
        {   cnt=1;
            for(long int j=i+1;j<n;j++)
            {
                if(v[j]<=t)
                {
                    cnt++;
                    if(cnt==c)
                        break;
                }
                else
                    break;
            }
            if(cnt==c)
                ans++;
        }
    }
    cout<<ans;

}


#include<bits/stdc++.h>
using namespace std ;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define lld long long int
int main()
{
    fast;
    long int n,c;
    lld t;
    cin>>n>>t>>c;
    vector<lld> v(n);
    for(long int i=0;i<n ;i++)
        cin>>v[i];
    lld ans=0,cnt=0;
    for(long int i=0;i<n;i++)
    {
        if(v[i]<=t)
        {   cnt=1;
            for(long int j=i+1;j<=i+c-1;j++)
            {
                if(v[j]<=t)
                {
                    cnt++;
                }
                else
                    break;
            }
            if(cnt==c)
                ans++;
        }
    }
    cout<<ans;

}


#include<bits/stdc++.h>
using namespace std ;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define lld long long int
int main()
{
    fast;
    long int n,c;
    lld t;
    cin>>n>>t>>c;
    vector<lld> v(n);
    for(long int i=0;i<n ;i++)
        cin>>v[i];
    lld ans=0,cnt=0;
    int flag=0;
    for(long int i=0;i<n;i++)
    {
        if(v[i]<=t)
        {
            cnt++;
        }
        else
        {
            if(cnt>=c)
            {
            ans+=cnt-(c-1);
            }
            cnt=0;

        }
        if(i==n-1&&cnt>=c)
        {
            ans+=cnt-(c-1);
        }
    }
    cout<<ans;

}


#include<bits/stdc++.h>
using namespace std ;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define lld long long int
int main()
{
    fast;
    long int n,c;
    lld t;
    cin>>n>>t>>c;
    vector<lld> v(n);
    for(long int i=0;i<n ;i++)
        cin>>v[i];
    lld ans=0,cnt=0;
    for(long int i=0;i<n;i++)
    {
        if(v[i]<=t)
        {
            cnt++;
        }
        else
        {
            cnt=0;
            continue;
        }
        if(cnt==c)
        {
            ans++;
            cnt=0;
            i=i-c+1;
        }
    }
    cout<<ans;

}


#include<bits/stdc++.h>
using namespace std ;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define lld long long int
int main()
{
    fast;
    long int n,c;
    lld t;
    cin>>n>>t>>c;
    vector<lld> v(n);
    for(long int i=0;i<n ;i++)
        cin>>v[i];
    lld ans=0,cnt=0;
    for(long int i=0;i<n;i++)
    {
        if(v[i]<=t)
        {
            cnt++;
        }
        else
        {
            if(cnt>=c)
            {
            ans+=cnt-(c-1);
            cnt=0;
            }
        }
        if(i==n-1&&cnt>=c)
        {
            ans+=cnt-(c-1);
        }
    }
    cout<<ans;

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const double PI = acos(-1.0);

int main(){
   ll n,t,c;
   int x=0,ans=0;
   cin>>n>>t>>c;
   for(int i=0;i<n;i++){
    ll k;cin>>k;
    if(k<=t)x++;
    else if(k>t && x>=c){ans += x-c+1;x=0;}
    if(i==n-1 && x>=c){ans += x-c+1;}
   }
   cout<<ans;
 return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const double PI = acos(-1.0);

int main(){
   bool l=0;
   ll n,t,c;
   cin>>n>>t>>c;
   ll a[n];
   for(int i=0;i<n;i++){
    ll x;cin>>x;
    if(x>t){a[i]=-1;l=1;}
    else{a[i]=x;}
   }
   //cout<<a[0]<<"_";
   if(!l){cout<<ceil(n/c)+1;return 0;}
   int x=0,ans=0;
   for(int i=0;i<n;i++){
    if(a[i]!=-1){x++;}
    else if(a[i]==-1 || i==n-1){
            if(x==0)
                ans+=0;
            else if(x%2==0)
                ans+=(x/c)+1;
            else{
                ans+=ceil((double)x/(double)c)+1;
            }x=0;
    }
    //cout<<ans<<" ";
   }
   cout<<ans;
 return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const double PI = acos(-1.0);

int main(){
   ll n,t,c;
   int x=0,ans=0;
   cin>>n>>t>>c;
   for(int i=0;i<n;i++){
    ll k;cin>>k;
    if(k<=t)x++;
    else if(k>t){if(x>=c){ans += x-c+1;}x=0;}
    if(i==n-1){if(x>=c){ans += x-c+1;}x=0;}
   }
   cout<<ans;
 return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const double PI = acos(-1.0);

int main(){
   ll n,t,c;
   int x=0,ans=0;
   cin>>n>>t>>c;
   for(int i=0;i<n;i++){
    ll k;cin>>k;
    if(k<=t)x++;
    else if(k>t){ans += x-c+1;x=0;}
    if(i==n-1){ans += x-c+1;}
   }
   cout<<ans;
 return 0;
}


#include <iostream>
#include <queue>

using namespace std;

int main()
{
    int n, t, c;
    cin >> n >> t >> c;
    int i, k, counter = 0;
    queue <int> segment;
    int ar[n];
    for(i = 0; i < n; i++){
        cin >> ar[i];
    }
    i = 0;
    k = 0;
    do{
        for(; i < k + c; i++){
            if(ar[i] <= t){
                segment.push(ar[i]);
            }else{
                break;
            }
        }
        if(i != k + c){
            for(int j = 0; j < i; j++){
                segment.pop();
            }
            k = ++i;
        }else{
            counter++;
            segment.pop();
            k++;
        }
    }while(i < n);
    cout << counter;
    return 0;
}


#include <iostream>
#include <queue>

using namespace std;

int main()
{
    int n, t, c;
    cin >> n >> t >> c;
    int i, k, counter = 0;
    queue <int> segment;
    int ar[n];
    for(i = 0; i < n; i++){
        cin >> ar[i];
    }
    i = 0;
    k = 0;
    do{
        for(; i < k + c; i++){
            if(ar[i] <= t){
                segment.push(ar[i]);
            }else{
                ++i;
                break;
            }
        }
        if(i != k + c){
            for(int j = 0; j < i; j++){
                segment.pop();
            }
            k = i;
        }else{
            counter++;
            segment.pop();
            k++;
        }
    }while(i < n);
    cout << counter;
    return 0;
}


#include <iostream>
#include <queue>

using namespace std;

int main()
{
    int n, t, c;
    cin >> n >> t >> c;
    int i, k, counter = 0;
    queue <int> segment;
    int ar[n];
    for(i = 0; i < n; i++){
        cin >> ar[i];
    }
    i = 0;
    k = 0;
    do{
        for(; i < k + c && i < n; i++){
            if(ar[i] <= t){
                segment.push(ar[i]);
            }else{
                break;
            }
        }
        if(i != k + c){
            for(int j = 0; j < i; j++){
                segment.pop();
            }
            k = ++i;
        }else{
            counter++;
            segment.pop();
            k++;
        }
    }while(i < n);
    cout << counter;
    return 0;
}


#include <iostream>
#include <queue>

using namespace std;

int main()
{
    int n, t, c;
    cin >> n >> t >> c;
    int i, k, counter = 0;
    int segment[c];
    int ar[n];
    for(i = 0; i < n; i++){
        cin >> ar[i];
    }
    i = 0;
    k = 0;
    int j = 0;
    do{
        for(; i < k + c && i < n; i++){
            if(ar[i] <= t){
                segment[j++] = ar[i];
            }else{
                break;
            }
        }
        if(j != c){
            j = 0;
            k = ++i;
        }else{
            counter++;
            for(int x = 0; x < c - 1; x++){
                segment[x] = segment[x + 1];
            }
            j--;
            k++;
        }
    }while(i < n);
    cout << counter;
    return 0;
}


#include <iostream>
#include <queue>

using namespace std;

int main()
{
    int n, t, c;
    cin >> n >> t >> c;
    int i, k, counter = 0;
    queue <int> segment;
    int ar[n];
    for(i = 0; i < n; i++){
        cin >> ar[i];
    }
    i = 0;
    k = 0;
    do{
        for(; i < k + c && i < n; i++){
            if(ar[i] <= t){
                segment.push(ar[i]);
            }else{
                break;
            }
        }
        if(i != k + c){
            for(int j = 0; j < i - k; j++){
                segment.pop();
            }
            k = ++i;
        }else{
            counter++;
            segment.pop();
            k++;
        }
    }while(i < n);
    cout << counter;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define forsn(i, s, n) for(tint i=s;i<tint(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

int main(){
	NACHO;
	int n, t, c; cin >> n >> t >> c;
	vector<int> a (n);
	int cont = 0;
	int last = -1;
	forn(i, n){
		cin >> a[i];
	}
	forn(i, n){
		if(a[i] > t){
			if(i-last-1 < c){last = i; continue;}
			cont+=((i-last-1)-c+1);
			last = i;
		}
	}
	if(n-last-1 >= c)cont+=(n-last-1)-c+1;
	cout << cont << "\n";
}


#include <bits/stdc++.h>

using namespace std;

#define forsn(i, s, n) for(tint i=s;i<tint(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

int main(){
	int n, t, c; cin >> n >> t >> c;
	vector<int> a (n);
	int cont = 0;
	int last = 0;
	forn(i, n){
		cin >> a[i];
		if(a[i] > t){
			cont+=((i-last-1)-c+1);
			last = i;
		}
	}
	cont+=(n-last)-c+1;
	cout << cont << "\n";
}


#include <bits/stdc++.h>

using namespace std;

#define forsn(i, s, n) for(tint i=s;i<tint(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

int main(){
	int n, t, c; cin >> n >> t >> c;
	vector<int> a (n);
	int cont = 0;
	int last = -1;
	forn(i, n){
		cin >> a[i];
	}
	forn(i, n){
		if(a[i] > t){
			if(i-last-1 < c){last = i; continue;}
			cont+=((i-last-1)-c+1);
			last = i;
		}
	}
	if(n-last-1 >= c)cont+=(n-last-1)-c+1;
	cout << cont << "\n";
}


#include <bits/stdc++.h>

using namespace std;

#define forsn(i, s, n) for(tint i=s;i<tint(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

int main(){
	int n, t, c; cin >> n >> t >> c;
	vector<int> a (n);
	int cont = 0;
	int last = 0;
	forn(i, n){
		cin >> a[i];
		if(a[i] > t){
			cont+=(((i-last-1)-c+1) >= 0 ? ((i-last-1)-c+1) : 0);
			last = i;
		}
	}
	cont+=(((n-last-1)-c+1) >= 0 ? ((n-last-1)-c+1) : 0);
	cout << cont << "\n";
}


#include <iostream>
#include <cstdio>
#include <iomanip>
#include <algorithm>

#define endl "\n"

using namespace std;

int i, j, n, a[1000], k, v, t, x;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

//    freopen("two.in", "r", stdin);
 //   freopen("two.out", "w", stdout);

 //   freopen("input.txt", "r", stdin);
 //   freopen("output.txt", "w", stdout);

    cin >> n >> t >> k;

    for (i = 0; i < n; i++) {
        cin >> a[i];
    }

    v = 0;
    for (i = 0; i <= n - k; i++) {
        for (j = i; j < i + k; j++) {
            if (a[j] > t) {
                break;
            }
            x++;
        }
        if (x == k) {
            v++;
        }
        x = 0;
    }

    cout << v << endl;
    return 0;

}


#include <iostream>
#include <cstdio>
#include <iomanip>
#include <algorithm>

#define endl "\n"

using namespace std;

long long i, j, n, a[100000], k, v, t, x;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

//    freopen("two.in", "r", stdin);
 //   freopen("two.out", "w", stdout);

 //   freopen("input.txt", "r", stdin);
 //   freopen("output.txt", "w", stdout);

    cin >> n >> t >> k;

    for (i = 0; i < n; i++) {
        cin >> a[i];
    }

    v = 0;
    for (i = 0; i < n; i++) {
        if (a[i] <= t) {
            x++;
        } else {
            x = 0;
        }
        if (x >= k) {
            v++;
        }
    }

    cout << v << endl;
    return 0;

}


#include <iostream>
#include <cstdio>
#include <iomanip>
#include <algorithm>

#define endl "\n"

using namespace std;

long long i, j, n, a[100000], k, v, t, x;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

//    freopen("two.in", "r", stdin);
 //   freopen("two.out", "w", stdout);

 //   freopen("input.txt", "r", stdin);
 //   freopen("output.txt", "w", stdout);

    cin >> n >> t >> k;

    for (i = 0; i < n; i++) {
        cin >> a[i];
    }

    v = 0;
    for (i = 0; i <= n - k; i++) {
        for (j = i; j < i + k; j++) {
            if (a[j] > t) {
                break;
            }
            x++;
        }
        if (x == k) {
            v++;
        }
        x = 0;
    }

    cout << v << endl;
    return 0;

}


#include <iostream>
#include <cstdio>
#include <iomanip>
#include <algorithm>

#define endl "\n"

using namespace std;

long long i, j, n, a, k, v, t, x;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

//    freopen("two.in", "r", stdin);
 //   freopen("two.out", "w", stdout);

 //   freopen("input.txt", "r", stdin);
 //   freopen("output.txt", "w", stdout);

    cin >> n >> t >> k;

    v = 0;
    for (i = 0; i < n; i++) {
        cin >> a;
        if (a <= t) {
            x++;
        } else {
            x = 0;
        }
        if (x >= k) {
            v++;
        }
    }

    cout << v << endl;
    return 0;

}


#include <iostream>
#include <cstdio>
#include <iomanip>
#include <algorithm>

#define endl "\n"

using namespace std;

int i, j, n, a[100000], k, v, t, x;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

//    freopen("two.in", "r", stdin);
 //   freopen("two.out", "w", stdout);

 //   freopen("input.txt", "r", stdin);
 //   freopen("output.txt", "w", stdout);

    cin >> n >> t >> k;

    for (i = 0; i < n; i++) {
        cin >> a[i];
    }

    v = 0;
    for (i = 0; i <= n - k; i++) {
        for (j = i; j < i + k; j++) {
            if (a[j] > t) {
                break;
            }
            x++;
        }
        if (x == k) {
            v++;
        }
        x = 0;
    }

    cout << v << endl;
    return 0;

}


#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <vector>
#include <cstdio>

using namespace std;

vector < int > vec;

int main(){
    int n,t,c;
    cin >> n >> t >> c;
    vec.push_back( -1 );
    for( int i=0; i<n; i++){
        int temp;
        scanf("%d",&temp);
        if(temp>t) vec.push_back(i);
    }
    vec.push_back(n);
    long long ans=0;
    for(int i=1; i< int( vec.size() ); i++){
        int diff = vec[i] - vec[i-1]-1;
        ans+= max( diff-c+1 , 0 );
    }
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>

int main(){
   int n, t, c;
   std::cin >> n >> t >> c;

   int ans = 0, act = 1;
   for (int i = 0; i < n; i++) {
       int k;
       std::cin >> k;
       if (k <= t){
           act += 1;
       }
       else{
           ans += std::max(0, act - c);
           act = 1;
       }
   }
   ans += std::max(0, act - c);
   std::cout << ans;
}


#include<bits/stdc++.h>

int main(){
   int n, t, c;
   std::cin >> n >> t >> c;

   int ans, act;
   ans = act = 0;
   for (int i = 0; i < n; i++) {
       int k;
       std::cin >> k;
       if (k <= t){
           act += 1;
       }
       else{
           ans += std::max(0, act - c + 1);
           act = 0;
       }
   }
   ans += std::max(0, act - c + 1);
   std::cout << ans;
}


#include<bits/stdc++.h>

int main(){
   std::ios::sync_with_stdio(false);
   std::cin.tie(0);;
   int n, t, c;
   std::cin >> n >> t >> c;

   int ans = 0, act = 1;
   for (int i = 0; i < n; i++) {
       int k;
       std::cin >> k;
       if (k <= t){
           act += 1;
       }
       else{
           ans += std::max(0, act - c);
           act = 1;
       }
   }
   ans += std::max(0, act - c);
   std::cout << ans;
}


#include<bits/stdc++.h>

int main(){
   int n, t, c;
   std::cin >> n >> t >> c;

   int ans, act;
   ans = act = 0;
   for (int i = 0; i < n; i++) {
       int k;
       std::cin >> k;
       if (k <= t){
           act += 1;
       }
       else{
           ans += std::min(act, act / c + 1);
           act = 0;
       }
   }
   std::cout << ans + std::min(act, act / c + 1);
}


#include <iostream>
using namespace std;
int main() {

  long n,t,c,sum=0,r=0,s;
  cin>>n>>t>>c;
  for(int i=1;i<=n;i++)
  {
    cin>>s;
    if(s<=t)r++;
    if(s>t)r=0;
    if(r==c){sum++;r--;}
  }
  cout<<sum;
}


#include <algorithm>
#include <iostream>
#include <vector>
#include<cmath>
using namespace std;
int main()
{
	int n,t,c,a,sum=0;
  vector<int>v;
  cin>>n>>t>>c;
  for(int i=0;i<n;i++)
   {
     cin>>a;
     if(a<=t)
     v.push_back(a);
   }
   if(v.size()%2==0)
   {sum=v.size()-c+1;}
   if(v.size()%2!=0)
   {sum=v.size()-c-1;}
  cout<<sum;
}


#include <iostream>
using namespace std;
int main() {

  long n,t,c,sum=0,r=0,s;
  cin>>n>>t>>c;
  for(int i=1;i<=n;i++)
  {
    cin>>s;
    if(s<=t)r++;
    if(r==c){sum++;r=0;}
  }
  cout<<sum;
}


#include <iostream>
using namespace std;
int main() {

  long n,t,c,sum=0,s;
  cin>>n>>t>>c;
  for(int i=1;i<=n;i++)
  {
    cin>>s;
    if(s>=t)continue;
    if(0<=i-c)sum++;
  }
  cout<<sum;
}


#include <iostream>
using namespace std;
int main() {

  long n,t,c,sum=0,r=0,s;
  cin>>n>>t>>c;
  for(int i=1;i<=n;i++)
  {
    cin>>s;
    if(i<t)r++;
    if(r==c){sum++;r=0;}
  }
  cout<<sum;
}


#include <iostream>
using namespace std;
int main() {

  int n,t,c,sum=0,r=0,s;
  cin>>n>>t>>c;
  for(int i=1;i<=n;i++)
  {
    cin>>s;
    if(s>t)r=s;
    if(r<=i-c)sum++;
  }
  cout<<sum;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
	long long n,t,c;
	cin>>n>>t>>c;
	long long* arr=new long long[n];
	long long len=0;
	long long ways=0;
	bool cont=false;
	cin>>arr[0];
	if(arr[0] <=t){cont=true; len++;}
	for(int i=1; i<n;i++){
		cin>>arr[i];
		if(arr[i] <=t && cont){
			len++;
		}
		else if(arr[i] <=t && !cont){
			len++;
			cont=true;
		}
		else{
			if(len>=c){
			if(len !=c) ways=ways+(len-c)+1;
			else ways=ways+1;
			}
			len=0;
			cont=false;
		}
	}
	if(len !=0 && len>=c) {
		if(len !=c) ways=ways+(len-c)+1;
		else ways=ways+1;
	}
	cout<<ways;

	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
	long long n,t,c;
	cin>>n>>t>>c;
	long long* arr=new long long[n];
	long long len=0;
	long long ways=0;
	bool cont=false;
	cin>>arr[0];
	if(arr[0] <=t){cont=true; len++;}
	for(int i=1; i<n;i++){
		cin>>arr[i];
		if(arr[i] <=t && cont){
			len++;
		}
		else if(arr[i] <=t && !cont){
			len++;
			cont=true;
		}
		else{
			if(len>=c){
			if(len !=c) ways=ways+(len-c)+1;
			else ways=ways++;
			len=0;
			}
			cont=false;
		}
	}
	if(len !=0 && len>=c) {
		if(len !=c) ways=ways+(len-c)+1;
		else ways=ways+1;
	}
	cout<<ways;

	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
	long long n,t,c;
	cin>>n>>t>>c;
	long long* arr=new long long[n];
	long long len=0;
	long long ways=0;
	bool cont=false;
	cin>>arr[0];
	if(arr[0] <=t){cont=true; len++;}
	for(int i=1; i<n;i++){
		cin>>arr[i];
		if(arr[i] <=t && cont){
			len++;
		}
		else if(arr[i] <=t && !cont){
			len++;
			cont=true;
		}
		else{
			if(len>=c){
			if(len !=c) ways=ways+(len/c)+1;
			else ways=ways++;
			len=0;
			}
			cont=false;
		}
	}
	if(len !=0 && len>=c) {
		if(len !=c) ways=ways+(len/c)+1;
		else ways=ways+1;
	}
	cout<<ways;

	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
	long long n,t,c;
	cin>>n>>t>>c;
	long long* arr=new long long[n];
	long long len=0;
	long long ways=0;
	bool cont=false;
	cin>>arr[0];
	if(arr[0] <=t){cont=true; len++;}
	for(int i=1; i<n;i++){
		cin>>arr[i];
		if(arr[i] <=t){
			len++;
		}
		else{
			if(len !=c) ways=ways+(len/c)+1;
			else ways=ways++;
			len=0;

		}
	}
	if(len !=0) {
		if(len !=c) ways=ways+(len/c)+1;
		else ways=ways+1;
	}
	cout<<ways;

	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
	long long n,t,c;
	cin>>n>>t>>c;
	long long* arr=new long long[n];
	long long len=0;
	long long ways=0;
	bool cont=false;
	cin>>arr[0];
	if(arr[0] <=t){cont=true; len++;}
	for(int i=1; i<n;i++){
		cin>>arr[i];
		if(arr[i] <=t && cont){
			len++;
		}
		else{
			if(len>=c){
			if(len !=c) ways=ways+(len/c)+1;
			else ways=ways++;
			len=0;
			}
		}
	}
	if(len !=0 && len>=c) {
		if(len !=c) ways=ways+(len/c)+1;
		else ways=ways+1;
	}
	cout<<ways;

	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
	long long n,t,c;
	cin>>n>>t>>c;
	long long* arr=new long long[n];
	long long len=0;
	long long ways=0;
	bool cont=false;
	cin>>arr[0];
	if(arr[0] <=t){cont=true; len++;}
	for(int i=1; i<n;i++){
		cin>>arr[i];
		if(arr[i] <=t && cont){
			len++;
		}
		else if(arr[i] <=t && !cont){
			len++;
			cont=true;
		}
		else{
			if(len>=c){
			if(len !=c) ways=ways+(len-c)+1;
			else ways=ways++;

			}
			len=0;
			cont=false;
		}
	}
	if(len !=0 && len>=c) {
		if(len !=c) ways=ways+(len-c)+1;
		else ways=ways+1;
	}
	cout<<ways;

	return 0;
}


#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <map>
#include <iomanip>
#include <set>

using namespace std;

#define fastio() ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)

#define fi(a, b) for (int i = (a); i < (b); ++i)
#define fj(a, b) for (int j = (a); j < (b); ++j)
#define fk(a, b) for (int k = (a); k < (b); ++k)
#define fir(a, b) for (int i = (a); i >= (b); --i)
#define fjr(a, b) for (int j = (a); j >= (b); --j)

#define pb(a) push_back((a))

#define mp(a, b) make_pair((a), (b))
#define F first
#define S second

using uint64 = uint64_t;
using int64 = int64_t;

using pii = pair<int, int>;

int a[200000];

int main()
{
	fastio();

	int n, t, c; cin >> n >> t >> c;
	fi(0, n) cin >> a[i];

	int res = 0,
		l = 0,
		r = 0;

	fi(0, n)
	{
		if (a[i] <= t)
		{
			r++;
		}
		else
		{
			if (r - l >= c)
			{
				res += r - l - c + 1;
			}

			l = r = i;
		}
	}

	res += r - l - c + 1;
	if(res < 0) res = 0;

	cout << res;

	return 0;
}


#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <map>
#include <iomanip>
#include <set>

using namespace std;

#define fastio() ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)

#define fi(a, b) for (int i = (a); i < (b); ++i)
#define fj(a, b) for (int j = (a); j < (b); ++j)
#define fk(a, b) for (int k = (a); k < (b); ++k)
#define fir(a, b) for (int i = (a); i >= (b); --i)
#define fjr(a, b) for (int j = (a); j >= (b); --j)

#define pb(a) push_back((a))

#define mp(a, b) make_pair((a), (b))
#define F first
#define S second

using uint64 = uint64_t;
using int64 = int64_t;

using pii = pair<int, int>;

int a[200000];

int main()
{
	fastio();

	int n, t, c; cin >> n >> t >> c;
	fi(0, n) cin >> a[i];

	int64 res = 0;
	int l = 0,
		r = 0;

	fi(0, n)
	{
		if (a[i] <= t)
		{
			r++;
		}
		else
		{
			if (r - l >= c)
			{
				res += r - l - c + 1;
			}

			l = r = i;
		}
	}

	res += r - l - c + 1;
	if(res < 0) res = 0;

	cout << res;

	return 0;
}


#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <map>
#include <iomanip>
#include <set>

using namespace std;

#define fastio() ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)

#define fi(a, b) for (int i = (a); i < (b); ++i)
#define fj(a, b) for (int j = (a); j < (b); ++j)
#define fk(a, b) for (int k = (a); k < (b); ++k)
#define fir(a, b) for (int i = (a); i >= (b); --i)
#define fjr(a, b) for (int j = (a); j >= (b); --j)

#define pb(a) push_back((a))

#define mp(a, b) make_pair((a), (b))
#define F first
#define S second

using uint64 = uint64_t;
using int64 = int64_t;

using pii = pair<int, int>;

int main()
{
	fastio();

	int n, t, c; cin >> n >> t >> c;
	int res = 0,
		count = 0;

	fi(0, n)
	{
		int a; cin >> a;
		if (a <= t)
			count++;
		else
			count = 0;

		if (count == c)
		{
			res++;
			count--;
		}
	}

	cout << res;

	return 0;
}


#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <map>
#include <iomanip>
#include <set>

using namespace std;

#define fastio() ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)

#define fi(a, b) for (int i = (a); i < (b); ++i)
#define fj(a, b) for (int j = (a); j < (b); ++j)
#define fk(a, b) for (int k = (a); k < (b); ++k)
#define fir(a, b) for (int i = (a); i >= (b); --i)
#define fjr(a, b) for (int j = (a); j >= (b); --j)

#define pb(a) push_back((a))

#define mp(a, b) make_pair((a), (b))
#define F first
#define S second

using uint64 = uint64_t;
using int64 = int64_t;

using pii = pair<int, int>;

int a[200000];

int main()
{
	fastio();

	int n, t, c; cin >> n >> t >> c;
	fi(0, n) cin >> a[i];

	int res = 0,
		l = 0,
		r = 0;

	fi(0, n)
	{
		if (a[i] <= t)
		{
			r++;
		}
		else
		{
			if (r - l >= c)
			{
				res += r - l - c + 1;
			}

			l = r = i;
		}
	}

	res += r - l - c + 1;
	cout << res;

	return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n,t,c,ip;

int main(){
    cin>>n>>t>>c;
    int ans=0,len=0;
    for(int i=0;i<n;i++){
        cin>>ip;
        if(ip<=t){
            len++;
            if(len>=c){
                ans++;
            }
        }
        else len=0;
    }
    cout<<ans<<endl;
}


#include<bits/stdc++.h>

using namespace std;
int n,t,c,ip;
int len=0,ans=0;

int main(){
    cin>>n>.t>>c;
    for(int i=0;i<n;i++){
        cin>>ip;
        if(ip<t){
            len++;
            if(len>=c){
                ans++
            }
        }
        else len=0;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n,t,c,ip;
int len=0,ans=0;

int main(){
    cin>>n>>t>>c;
    for(int i=0;i<n;i++){
        cin>>ip;
        if(ip<t){
            len++;
            if(len>=c){
                ans++;
            }
        }
        else len=0;
    }
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n,t,c,ip;
int len=0,ans=0;

int main(){
    cin>>n>>t>>c;
    for(int i=0;i<n;i++){
        cin>>ip;
        if(ip<t){
            len++;
            if(len>=c){
                ans++
            }
        }
        else len=0;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n,t,c,ip;
int len=0;

int main(){
    cin>>n>>t>>c;
    int ans=0;
    for(int i=0;i<n;i++){
        cin>>ip;
        if(ip<t){
            len++;
            if(len>=c){
                ans++;
            }
        }
        else len=0;
    }
    cout<<ans<<endl;
}


#include<bits/stdc++.h>

using namespace std;
int n,t,c,ip;
int len=0,ans;

int main(){
    cin>>n>>t>>c;
    for(int i=0;i<n;i++){
        cin>>ip;
        if(ip<t){
            len++;
            if(len>=c){
                ans++;
            }
        }
        else len=0;
    }
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n,t,c,ip;
int len=0;

int main(){
    cin>>n>>t>>c;
    int ans=0;
    for(int i=0;i<n;i++){
        cin>>ip;
        if(ip<t){
            len++;
            if(len>=c){
                ans++;
            }
        }
        else len=0;
    }
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n,t,c,ip;
int len=0,ans=0;

int main(){
    cin>>n>>t>>c;
    for(int i=0;i<n;i++){
        cin>>ip;
        if(ip<t){
            len++;
            if(len>=c){
                ans++;            }
        }
        else len=0;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n,t,c,ip;

int main(){
    cin>>n>>t>>c;
    int ans=0,len=0;
    for(int i=0;i<n;i++){
        cin>>ip;
        if(ip<t){
            len++;
            if(len>=c){
                ans++;
            }
        }
        else len=0;
    }
    cout<<ans<<endl;
}


#include<bits/stdc++.h>

using namespace std;
int n,t,c,ip;

int main(){
    cin>>n>>t>>c;
    int ans=0,len=0;
    for(int i=0;i<n;i++){
        cin>>ip;
        if(ip<t){
            len++;
            if(len>=c){
                ans++;
            }
        }
        else len=0;
    }
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
#define fil(x) memset(x, 0, sizeof(x))
#define fillb(x) memset(x,false,sizeof(x))
#define fillm(x) memset(x, -1, sizeof(x))
#define mp make_pair
#define pll pair<int, int>
#define pf printf
#define sf scanf
#define all(x) x.begin(),x.end()
#define pb push_back
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define np std::string::npos
#define fo(i,n) for(int i=0;i<n;i++)
#define of(i,n) for(int i=n-1;i>=0;i--)
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define cases(cs,t) for(int cs=1;cs<=t;cs++)
#define PI acos(-1)

typedef unsigned long long lll;
typedef long long ll;
int knigtx8[] = {2, 2, -2, -2, 1, 1, -1, -1}; ///knight move in chess
int knigty8[] = {1, -1, 1, -1, 2, -2, 2, -2}; ///knight move in chess
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}; ///for 8 directions
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1}; ///for 8 directions
int dx4[] = {0, 0, 1, -1}; ///for 4 directions
int dy4[] = {1, -1, 0, 0}; ///for 4 directions
const int maxx=100005;

//this fuction sorts vector pair according to first element in descending order.
bool sortinrev(const pair<int,int> &a,const pair<int,int> &b)
{
    return a.first>b.first;
}

int atoz(){
    int frnt,bck,nibo,present,i;string s;
        frnt = abs(s[i]-present);
        bck = 26-frnt;
        nibo = min(frnt,bck);
}

template<typename T>inline T Bigmod(T base, T power, T MOD){
    T ret=1;
    while(power)
    {
        if(power & 1)ret=(ret*base)%MOD;
        base=(base*base)%MOD;
        power>>=1;
    }
    return ret;
}

int main()
{
    IOS;
    ll n,t,c;
    cin>>n>>t>>c;
    ll a[n];
    fo(i,n)
    {
        cin>>a[i];
    }
    ll cnt=0,ways=0;
    bool bl = false, b=false;
    fo(i,n){
        if(a[i]<=t){
            cnt++;
            if(cnt>=c){
                b = true;
            }
        }
        else{
            bl = true;
        }
        if(bl and b){
                //cout<<"cnt="<<cnt<<endl;
            if(cnt>=c){
                ways+=(cnt-c+1);
            }
            bl =false;
            b = false;
            cnt=0;
        }
    }
    if(b){
        ways+=(cnt-c+1);
    }

    cout<<ways<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
#define fil(x) memset(x, 0, sizeof(x))
#define fillb(x) memset(x,false,sizeof(x))
#define fillm(x) memset(x, -1, sizeof(x))
#define mp make_pair
#define pll pair<int, int>
#define pf printf
#define sf scanf
#define all(x) x.begin(),x.end()
#define pb push_back
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define np std::string::npos
#define fo(i,n) for(int i=0;i<n;i++)
#define of(i,n) for(int i=n-1;i>=0;i--)
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define cases(cs,t) for(int cs=1;cs<=t;cs++)
#define PI acos(-1)

typedef unsigned long long lll;
typedef long long ll;
int knigtx8[] = {2, 2, -2, -2, 1, 1, -1, -1}; ///knight move in chess
int knigty8[] = {1, -1, 1, -1, 2, -2, 2, -2}; ///knight move in chess
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}; ///for 8 directions
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1}; ///for 8 directions
int dx4[] = {0, 0, 1, -1}; ///for 4 directions
int dy4[] = {1, -1, 0, 0}; ///for 4 directions
const int maxx=100005;

//this fuction sorts vector pair according to first element in descending order.
bool sortinrev(const pair<int,int> &a,const pair<int,int> &b)
{
    return a.first>b.first;
}

int atoz(){
    int frnt,bck,nibo,present,i;string s;
        frnt = abs(s[i]-present);
        bck = 26-frnt;
        nibo = min(frnt,bck);
}

template<typename T>inline T Bigmod(T base, T power, T MOD){
    T ret=1;
    while(power)
    {
        if(power & 1)ret=(ret*base)%MOD;
        base=(base*base)%MOD;
        power>>=1;
    }
    return ret;
}

int main()
{
    IOS;
    ll n,t,c;
    cin>>n>>t>>c;
    ll a[n];
    fo(i,n)
    {
        cin>>a[i];
    }
    ll cnt=0,ways=0;
    bool bl = false, b=false;
    fo(i,n){
        if(a[i]<=t){
            cnt++;
            if(cnt>=c){
                b = true;
            }
            else b =false;
        }
        else{
            bl = true;
            cnt = 0;
        }
        if(bl and b){
                //cout<<"cnt="<<cnt<<endl;
            if(cnt>=c){
                ways+=(cnt-c+1);
            }
            bl =false;
            b = false;
            cnt=0;
        }
    }
    if(b){
        ways+=(cnt-c+1);
    }

    cout<<ways<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
#define fil(x) memset(x, 0, sizeof(x))
#define fillb(x) memset(x,false,sizeof(x))
#define fillm(x) memset(x, -1, sizeof(x))
#define mp make_pair
#define pll pair<int, int>
#define pf printf
#define sf scanf
#define all(x) x.begin(),x.end()
#define pb push_back
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define np std::string::npos
#define fo(i,n) for(int i=0;i<n;i++)
#define of(i,n) for(int i=n-1;i>=0;i--)
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define cases(cs,t) for(int cs=1;cs<=t;cs++)
#define PI acos(-1)

typedef unsigned long long lll;
typedef long long ll;
int knigtx8[] = {2, 2, -2, -2, 1, 1, -1, -1}; ///knight move in chess
int knigty8[] = {1, -1, 1, -1, 2, -2, 2, -2}; ///knight move in chess
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}; ///for 8 directions
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1}; ///for 8 directions
int dx4[] = {0, 0, 1, -1}; ///for 4 directions
int dy4[] = {1, -1, 0, 0}; ///for 4 directions
const int maxx=100005;

//this fuction sorts vector pair according to first element in descending order.
bool sortinrev(const pair<int,int> &a,const pair<int,int> &b)
{
    return a.first>b.first;
}

int atoz(){
    int frnt,bck,nibo,present,i;string s;
        frnt = abs(s[i]-present);
        bck = 26-frnt;
        nibo = min(frnt,bck);
}

template<typename T>inline T Bigmod(T base, T power, T MOD){
    T ret=1;
    while(power)
    {
        if(power & 1)ret=(ret*base)%MOD;
        base=(base*base)%MOD;
        power>>=1;
    }
    return ret;
}

int main()
{
    IOS;
    ll n,t,c;
    cin>>n>>t>>c;
    ll a[n];
    fo(i,n)
    {
        cin>>a[i];
    }
    ll cnt=0,ways=0;
    bool bl = false, b=false;
    fo(i,n){
        if(a[i]<=t){
            cnt++;
            if(cnt>=c){
                b = true;
            }
            else b =false;
        }
        else{
            bl = true;
        }
        if(bl){
                //cout<<"cnt="<<cnt<<endl;
            if(cnt>=c){
                ways+=(cnt-c+1);
            }
            bl =false;
            b = false;
            cnt=0;
        }
    }
    if(b){
        ways+=(cnt-c+1);
    }

    cout<<ways<<endl;
    return 0;
}


#include <iostream>
#include <array>
#include <string>
using namespace std;
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mem(a,b) memset(a,b,sizeof(a))
#define int long long
const int MOD = 1e9 + 7;

int n, x, k;
int a[200007];
signed main()
{
    IOS
    //int t; cin >> t; while (t--)
    {
        cin >> n >> x >> k;
        int total = 0;
        for (int i = 0; i < n; ++i) cin >> a[i];
        for (int i = 0; i < n - k; ++i) {
            sort(a + i, a + k);
            if (a[i + k - 1] <= x) {
                ++total;
            }
        }
        cout << total << "\n";
    }
    return 0;
}


#include <iostream>
#include <array>
#include <string>
using namespace std;
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mem(a,b) memset(a,b,sizeof(a))
#define int long long
const int MOD = 1e9 + 7;

int n, x, k;
int a[200007];
signed main()
{
    IOS
    //int t; cin >> t; while (t--)
    {
        cin >> n >> x >> k;
        int total, c;
        total = c = 0;
        for (int i = 0; i < n; ++i) {
            int a;
            cin >> a;
            if (a <= x) ++c;
            else c = 0;
            if (c >= k) ++total;
        }
        cout << total << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <array>
#include <string>
using namespace std;
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mem(a,b) memset(a,b,sizeof(a))
#define int long long
const int MOD = 1e9 + 7;

int n, x, k;
int a[200007];
signed main()
{
    IOS
    //int t; cin >> t; while (t--)
    {
        cin >> n >> x >> k;
        int total = 0;
        for (int i = 0; i < n; ++i) cin >> a[i];
        for (int i = 0; i <= n - k; ++i) {
            sort(a + i, a + k);
            if (a[i + k - 1] <= x) {
                ++total;
            }
        }
        cout << total << "\n";
    }
    return 0;
}