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.IOException; 
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*; 

public class Main 
{ 	


    public final static int OO = Integer.MAX_VALUE;
    private static Reader r; 	


	public static void main(String[] args)throws Exception 	 	
	{ 	 		
		r = new Reader(); 	 

		r.readLine();
		int n = r.readInt(0);
		int m = r.readInt(1);
		int v = r.readInt(2);
		
		int tempM = m;
		
		StringBuilder ans = new StringBuilder();
		
		for(int i=1;i<=n;++i)
		{
			if(i==v)
				continue;
			
			if(m==0)
				break;
			
			ans.append(i);
			ans.append(" ");
			ans.append(v);
			ans.append("\n");
			--m;
		}
		
		int ignore = v==1?2:1;
		
		for(int i=1;i<=n;++i)
		{
			if(i==v || i==ignore)
				continue;
			
			for(int j=i+1;j<=n;++j)
			{
				if(m==0)
					break;
					
				if(j==v || j==ignore)
					continue;
					
				ans.append(i);
				ans.append(" ");
				ans.append(j);
				ans.append("\n");
				--m;
			}
		}
		
		System.out.print(m!=0 || tempM<n-1?-1:ans.toString().trim());
		
		r.close(); 	
	}

	private static void dfs(int v, boolean []flag, List<List<Integer>> graph)
	{
		flag[v] = true;

		for (int u:graph.get(v))
		{
			if (!flag[u])
			{
				dfs(u, flag, graph);
			}
		}

	}
	
	private static int bfs(List<List<Integer>> graph, int v)
	{
		Queue<Integer> queue = new LinkedList<>();

		queue.add(v);

		boolean flag[] = new boolean[graph.size()];

		while (!queue.isEmpty())
		{
			v = queue.poll();

			flag[v] = true;

			for (int u:graph.get(v))
				if (!flag[u])
				{
					queue.add(u);
				}
		}
		return v;
	}

	private static int longestPathInTree(List<List<Integer>> graph, int v)
	{
		v = bfs(graph,v);

		Queue<Pair> level = new LinkedList<>();

		boolean []isV = new boolean[graph.size()];

		Pair p = new Pair(v, 0);
		level.add(p);

		while (!level.isEmpty())
		{
			p = level.poll();
			isV[p.f] = true;
			v = p.f;


			for (int u:graph.get(v))
				if (!isV[u])
				{
					level.add(new Pair(u, p.s + 1));
				}
		}


		return p.s;
	}

} 


class Pair implements Comparable<Pair>
{ 	
	int f,s; 	
	public Pair() 	
	{} 
	public Pair(int f, int s) 	
	{ 	
		this.f = f; 	
		this.s = s; 	
	} 

	@Override 	
	public String toString() 
	{ 		
		return f + " " + s; 	
	} 	

	@Override 	
	public int compareTo(Pair o) 	
	{ 		
		if (f == o.f) 			
			return s - o.s; 		
		return f - o.f; 	
	} 
}

class Reader
{ 	
	private BufferedReader reader; 
	private String line[]; 	

	public Reader() 	
	{ 		
		reader = new BufferedReader(new InputStreamReader(System.in)); 	
	} 	

	public String[] getLine() 	
	{ 		
		return line; 	
	} 	

	public void readLine() 	throws IOException 
	{ 		
		line = reader.readLine().split(" "); 	
	} 	

	public List<Integer> getIntegersList()
	{
		List<Integer> res = new ArrayList<>();
		for (String str:line)
			res.add(Integer.parseInt(str));
		return res;

	}

	public int readInt(int pos)throws IOException 	
	{ 		
		return Integer.parseInt(line[pos]); 	
	} 	

	public double readDouble(int pos)throws IOException 	
	{ 		
		return Double.parseDouble(line[pos]); 	
	} 	

	public long readLong(int pos)throws IOException 
	{ 		
		return Long.parseLong(line[pos]); 
	} 	

	public String readString(int pos)throws IOException 	
	{ 		
		return line[pos]; 	
	} 	

	public void close()throws IOException 
	{ 		
		reader.close(); 	
	}

}

class Vertix implements Comparable<Vertix>
{
	int to,w;

	public Vertix(int to, int w)
	{
		this.to = to;
		this.w = w;
	}

	@Override
	public int compareTo(Vertix p1)
	{
		return w - p1.w;
	}

}

class Dijkstra
{
	boolean isDirected;
	int n;
	List<List<Vertix>> adjList;
	int distance[];
	int parent[];
	boolean visited[];

	Dijkstra(int n, boolean isDirected)
	{
		this.isDirected = isDirected;
		this.n = n;
		adjList = new ArrayList<>();
		distance = new int[n + 1];
		parent = new int[n + 1];
		visited = new boolean[n + 1];

		for (int i=0;i <= n;++i)
		{
			adjList.add(new ArrayList<Vertix>());
			distance[i] = Main.OO;
			parent[i] = -1;

		}

	}

	void addEdge(int fr, int to, int w)
	{
		adjList.get(fr).add(new Vertix(to, w));

		if (!isDirected)
			adjList.get(to).add(new Vertix(fr, w));

	}

	Stack<Integer> getShortestPath(int src, int dis)
	{
		PriorityQueue<Vertix> queue = new PriorityQueue<>();

		distance[src] = 0;
		queue.add(new Vertix(src, 0));

		while (!queue.isEmpty())
		{
			Vertix v = queue.poll();
			int to = v.to;

			if (visited[to])
				continue;

			if (to == dis)
			{

				Stack<Integer> res = new Stack<>();

				res.add(dis);

				for (int c=parent[dis];c != src;c = parent[c])
					res.add(c);

				res.add(src);

				return res;
			}

			visited[to] = true;

			for (Vertix vv:adjList.get(to))
			{
				if (!visited[vv.to] && distance[vv.to] > distance[to] + vv.w)
				{
					distance[vv.to] = distance[to] + vv.w;
					parent[vv.to] = to;
					queue.add(new Vertix(vv.to, distance[vv.to]));
				}
			}
		}
		return null;

	}

}