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.*;
import java.math.*;
import java.util.*;

public class Task22C implements Runnable
{
    @SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"})
    private InputReader in;
    private PrintWriter out;

    private void solve()
    {
        int n = in.nextInt();
        int m = in.nextInt();
        int v = in.nextInt();
        int partOne = n - 2;
        int partTwo = 1;
        int maxEdge = partOne * (partOne - 1) / 2 + partTwo * (partTwo - 1) / 2 + partOne + partTwo;
        if (m > maxEdge || m < n - 1)
        {
            out.println(-1);
            return;
        }
        for (int i = 1; i <= partOne && m-- > 0; ++i)
        {
            int j = i < v ? i : i + 1;
            out.println(j + " " + v);
        }
        for (int i = partOne + 1; i <= n - 1 && m-- > 0; ++i)
        {
            int j = i < v ? i : i + 1;
            out.println(v + " " + j);
        }
        for (int i = 1; i <= partOne && m > 0; ++i)
            for (int j = i + 1; j <= partOne && m-- > 0; ++j)
            {
                int x = i < v ? i : i + 1;
                int y = j < v ? j : j + 1;
                out.println(x + " " + y);
            }
        for (int i = partOne + 1; i <= n - 1 && m > 0; ++i)
            for (int j = i + 1; j <= n - 1 && m-- > 0; ++j)
            {
                int x = i < v ? i : i + 1;
                int y = j < v ? j : j + 1;
                out.println(x + " " + y);
            }
    }

    public static void main(String[] args)
    {
        new Task22C().run();
    }

    private Task22C()
    {
        @SuppressWarnings({"UnusedDeclaration"})
        String id = getClass().getName().toLowerCase();
        try
        {
            // System.setIn(new FileInputStream(id + ".in"));
            // System.setOut(new PrintStream(new FileOutputStream(id + ".out")));
            // System.setIn(new FileInputStream("input.txt"));
            // System.setOut(new PrintStream(new FileOutputStream("output.txt")));
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
        in = new InputReader(System.in);
        out = new PrintWriter(System.out);
    }

    public void run()
    {
        // int testCount = in.readInt();
        // for (int i = 0; i < testCount; i++)
        // while (true)
        solve();
        exit();
    }

    @SuppressWarnings({"UnusedDeclaration"})
    private void exit()
    {
        out.close();
        System.exit(0);
    }

    @SuppressWarnings({"UnusedDeclaration"})
    private static class InputReader
    {
        private InputStream stream;
        private byte buf[] = new byte[1024];
        private int curChar, numChars;

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

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

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

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

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

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

        private String readLine()
        {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1)
            {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public BigInteger nextBigInteger()
        {
            try
            {
                return new BigInteger(next());
            }
            catch (NumberFormatException e)
            {
                throw new InputMismatchException();
            }
        }

        public char nextChar()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            return (char) c;
        }

        public double nextDouble()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.')
            {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.')
            {
                c = read();
                double m = 1;
                while (!isSpaceChar(c))
                {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
    }
}