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:
//package codeforces.br22;

import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * User: Kandy
 * Date: 29.06.2010
 * Time: 21:37:47
 */
public class ProblemC {
    public void solve() {
        boolean oj = true;

        try {
            Reader reader = oj ? new InputStreamReader(System.in) : new FileReader("C.in");
            Writer writer = oj ? new OutputStreamWriter(System.out) : new FileWriter("C.out");
            BufferedReader br = new BufferedReader(reader);
            StreamTokenizer st = new StreamTokenizer(reader);
            PrintWriter out = new PrintWriter(writer);

            MyTokenizer tok = new MyTokenizer(br.readLine());
            int n = (int)tok.getNum();
            int m = (int)tok.getNum();
            int v = (int)tok.getNum();

            if (m < n - 1) {
                out.printf("-1");
            } else {
                v--;
                n--;
                int[][] edges = new int[m][2];
                int cur = 0;
                for(int i=0;i<n;i++) {
                    edges[cur][0] = i;
                    edges[cur][1] = i + 1;
                    cur++;
                }
                if (cur < m) {
                    for(int i=0;i<n;i++) {
                        for(int j=i+2;j<n;j++) {
                            edges[cur][0] = i;
                            edges[cur][1] = j;
                            cur++;
                            if (cur == m)
                                break;
                        }
                        if (cur == m)
                            break;
                    }
                }
                /*
                while (i < n && cur < m) {
                    edges[cur][0] = i;
                    edges[cur][1] = n;
                    i++;
                    cur++;
                }
                if (cur < m) {
                    int s1 = 0;
                    int f1 = n / 2 - 1;
                    int s2 = n / 2;
                    int f2 = n - 1;
                    for(i = s1; i<=f1;i++) {
                        for(int j=i + 1;j<=f1;j++) {
                            edges[cur][0] = i;
                            edges[cur][1] = j;
                            cur++;
                            if (cur == m)
                                break;
                        }
                        if (cur == m)
                            break;
                    }
                    for(i = s2; i<=f2;i++) {
                        for(int j=i + 1;j<=f2;j++) {
                            edges[cur][0] = i;
                            edges[cur][1] = j;
                            cur++;
                            if (cur == m)
                                break;
                        }
                        if (cur == m)
                            break;
                    }
                }
                */
                if (cur < m) {
                    out.printf("-1");
                } else {
                    for(int i=0;i<m;i++) {
                        int f1 = edges[i][0];
                        int f2 = edges[i][1];
                        if (f1 == n - 1)
                            f1 = v;
                        else if (f1 == v)
                            f1 = n - 1;
                        if (f2 == n - 1)
                            f2 = v;
                        else if (f2 == v)
                            f2 = n - 1;
                        f1++;
                        f2++;
                        if (i < m - 1) {
                            out.printf("%d %d\n", f1, f2);
                        } else {
                            out.printf("%d %d", f1, f2);                            
                        }
                    }
                }
            }

            br.close();
            out.close();
            reader.close();
            writer.close();
        }
        catch (Exception ex) {
            ex.printStackTrace();
        }
        finally {
        }
    }


    public static void main(String[] args) {
        ProblemC f = new ProblemC();
        f.solve();
    }

    private class MyTokenizer {
        private String s;
        private int cur;

        public MyTokenizer(String s) {
            this.s = s;
            cur = 0;
        }

        public void skip() {
            while (cur < s.length() && (s.charAt(cur) == ' ' || s.charAt(cur) == '\n')) {
                cur++;
            }
        }

        public double getNum() {
            skip();
            String snum = "";
            while (cur < s.length() && (s.charAt(cur) >= '0' && s.charAt(cur) <= '9' || s.charAt(cur) == '.' || s.charAt(cur) == '-')) {
                snum += s.charAt(cur);
                cur++;
            }
            return Double.valueOf(snum);
        }

        public String getString() {
            skip();
            String s2 = "";
            while (cur < s.length() && (((s.charAt(cur) >= 'a' && s.charAt(cur) <= 'z')) || ((s.charAt(cur) >= 'A' && s.charAt(cur) <= 'Z')))) {
                s2 += s.charAt(cur);
                cur++;
            }
            return s2;
        }

        public char getCurrentChar() throws Exception {
            if (cur < s.length())
                return s.charAt(cur);
            else
                throw new Exception("Current character out of string length");
        }

        public void moveNextChar() {
            if (cur < s.length())
                cur++;
        }

        public boolean isFinished() {
            return cur >= s.length();
        }
    }
}