Problem: Bob got a job as a system administrator in X corporation. His first task was to connect n servers with the help of m two-way direct connection so that it becomes possible to transmit data from one server to any other server via these connections. Each direct connection has to link two different servers, each pair of servers should have at most one direct connection. Y corporation, a business rival of X corporation, made Bob an offer that he couldn't refuse: Bob was asked to connect the servers in such a way, that when server with index v fails, the transmission of data between some other two servers becomes impossible, i.e. the system stops being connected. Help Bob connect the servers.

Input

The first input line contains 3 space-separated integer numbers n, m, v (3 ≤ n ≤ 105, 0 ≤ m ≤ 105, 1 ≤ v ≤ n), n — amount of servers, m — amount of direct connections, v — index of the server that fails and leads to the failure of the whole system.

Output

If it is impossible to connect the servers in the required way, output -1. Otherwise output m lines with 2 numbers each — description of all the direct connections in the system. Each direct connection is described by two numbers — indexes of two servers, linked by this direct connection. The servers are numbered from 1. If the answer is not unique, output any.

Examples

Input

5 6 3


Output

1 2
2 3
3 4
4 5
1 3
3 5


Input

6 100 1


Output

-1

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
 	
 
public class apples {
	
	static ArrayList<Integer> [] ar;
	static int[] dfs_low,dfs_num,parent,numOfChildren;
	static int counter,root,rootChildren,count;
	static boolean [] artPoints;
	
	static void dfs(int u){
		dfs_num[u] = dfs_low[u] = ++counter;
		for(int v:ar[u]){
			if(dfs_num[v]==0){
				parent[v] = u;
				if(u==root)
					++rootChildren;
				dfs(v);
				if(dfs_low[v]>=dfs_num[u]){
					artPoints[u]=true;
					numOfChildren[u]++;
				}
				dfs_low[u] = Math.min(dfs_low[v], dfs_low[u]);
			}
			else{
				if(parent[u]!=v)
					dfs_low[u] = Math.min(dfs_low[u], dfs_num[v]);
			}
		}
	}
	
	public static void main(String args[]) throws IOException{
		//FileReader in = new FileReader("C:/test.txt");
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		
		
		
		
		long n = sc.nextLong();
		long m = sc.nextLong();
		int d = sc.nextInt();
		
		
		
		if(m<n-1 || m> (n-1)*(n-2)/2  +1){
			out.println(-1);
			out.flush();
			return;
		}
		int chosen=0;
		if(d==1)
			chosen=2;
		else
			chosen=1;
		int remaining[] = new int[(int) (n-1)];
		remaining[0] = d;
		int y=1;
		for(int i=1; i<n-1; i++){
			while(y==chosen || y==d){
				y++;
			}
			remaining[i] = y;
			y++;
		}
		for(int i=1; i<n-1; i++){
			//o.printf("%s %s\n", d, remaining[i]);
			out.printf("%s %s\n", d, remaining[i]);
			
			out.flush();
			m--;
		}
		//o.printf("%s %s\n", d,chosen);
		out.printf("%s %s\n", d,chosen);
		
		out.flush();
		m--;
		if(m>0){
			for(int i=1; i<n-1; i++){
				for(int j=i+1; j<n-1; j++){
					if(m==0)
						return;
					out.printf("%s %s\n",remaining[i],remaining[j]);
					//o.println(remaining[i]+" "+remaining[j]);
					out.flush();
					m--;
				}
			}
		}
		
		
	}
	
	
	
	
	
	
	
	static class Edge implements Comparable<Edge>
	{
		int u, v;
		Edge(int a,int d){ u=a; v=d;}
		public int compareTo(Edge e){return u!=e.u?u-e.u:v-e.v;}
	}
	
	static class UnionFind{
		int [] p, rank;
		UnionFind(int N){
			p = new int[N];
			rank = new int[N];
			for(int i=0; i<N; i++)
				p[i] = i;
		}
		
		int findSet(int x){ return p[x]==x?x:(p[x]=findSet(p[x]));}
		
		boolean union(int x, int y){
			x = findSet(x);
			y = findSet(y);
			
			if(x==y)
				return false;
			if(rank[x]>rank[y])
				p[y] = x;
			else{
				p[x] = y;
				if(rank[x]==rank[y])
					++rank[y];
			}
			return true;
		}
	}
	
	
	public class pair implements Comparable<pair>{
		int a;
		int b;
		int c;
		public pair(int a, int b) {
			this.a = a;
			this.b = b;
			
		}
		public int compareTo(pair o) {
			if(a!=o.a)
				return a-o.a;
			else 
				return b-o.b;
			
		}
 
	}
	
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

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

		public Scanner(String f) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(f));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

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

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

		public boolean ready() throws IOException {
			return br.ready();
		}

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

		public int[] nextIntArray1(int n) throws IOException {
			int[] a = new int[n + 1];
			for (int i = 1; i <= n; i++)
				a[i] = nextInt();
			return a;
		}

		public int[] shuffle(int[] a, int n) {
			int[] b = new int[n];
			for (int i = 0; i < n; i++)
				b[i] = a[i];
			Random r = new Random();
			for (int i = 0; i < n; i++) {
				int j = i + r.nextInt(n - i);
				int t = b[i];
				b[i] = b[j];
				b[j] = t;
			}
			return b;
		}

		public int[] nextIntArraySorted(int n) throws IOException {
			int[] a = nextIntArray(n);
			a = shuffle(a, n);
			Arrays.sort(a);
			return a;
		}

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

		public long[] nextLongArray1(int n) throws IOException {
			long[] a = new long[n + 1];
			for (int i = 1; i <= n; i++)
				a[i] = nextLong();
			return a;
		}

		public long[] nextLongArraySorted(int n) throws IOException {
			long[] a = nextLongArray(n);
			Random r = new Random();
			for (int i = 0; i < n; i++) {
				int j = i + r.nextInt(n - i);
				long t = a[i];
				a[i] = a[j];
				a[j] = t;
			}
			Arrays.sort(a);
			return a;
		}
	}
	
	
	
	//
}