// CodeForces Round #673 D competition

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.PriorityQueue;

public class BearTwoPaths {

	int n,k;
	int a,b,c,d;
	int []pa;
	int []pb;

	private void readData(BufferedReader bin) throws IOException {
		String s = bin.readLine();
		String []ss = s.split(" ");
		n = Integer.parseInt(ss[0]);
		k = Integer.parseInt(ss[1]);
		// read t
		s = bin.readLine();
		ss = s.split(" ");
		a = Integer.parseInt(ss[0]);
		b = Integer.parseInt(ss[1]);
		c = Integer.parseInt(ss[2]);
		d = Integer.parseInt(ss[3]);
	}

	void printRes() {
		if (pa==null) {
			System.out.println(-1);
			return;
		}
		for (int i=0; i<n; i++) {
			System.out.print(pa[i] + " ");
		}
		System.out.println();
		for (int i=0; i<n; i++) {
			System.out.print(pb[i] + " ");
		}
		System.out.println();
	}

	private void calculate() {
		if (n==4 || k<n+1) {
			pa = null;
			return;
		}
		pa = new int[n];
		pb = new int[n];
		// moving a->0 c->1 d->2 b->n-1
		int []idx = new int[n];
		idx[0] = a;
		idx[1] = c;
		idx[n-2] = d;
		idx[n-1] = b;
		int ii = 1;
		// fill all other indexes
		for (int i=2; i<n-2; i++) {
			while (!(ii!=a && ii!=b && ii!=c && ii!=d)) {
				ii++;
			}
			idx[i] = ii++;
		}
		for (int i=0; i<n; i++) {
			pa[i] = idx[i];
			pb[i] = idx[i];
		}
		pb[0] = c;
		pb[1] = a;
		pb[n-2] = b;
		pb[n-1] = d;
	}

	public static void main(String[] args) throws IOException {
		// BufferedReader bin = new BufferedReader(new FileReader("cactus.in"));
		BufferedReader bin = new BufferedReader(
				new InputStreamReader(System.in));
		BearTwoPaths l = new BearTwoPaths();
		l.readData(bin);
		l.calculate();
		l.printRes();
	}
}


// CodeForces Round #673 D competition

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.PriorityQueue;

public class BearTwoPaths {

	int n,k;
	int a,b,c,d;
	int []pa;
	int []pb;

	private void readData(BufferedReader bin) throws IOException {
		String s = bin.readLine();
		String []ss = s.split(" ");
		n = Integer.parseInt(ss[0]);
		k = Integer.parseInt(ss[1]);
		// read t
		s = bin.readLine();
		ss = s.split(" ");
		a = Integer.parseInt(ss[0]);
		b = Integer.parseInt(ss[1]);
		c = Integer.parseInt(ss[2]);
		d = Integer.parseInt(ss[3]);
	}

	void printRes() {
		if (pa==null) {
			System.out.println(-1);
			return;
		}
		for (int i=0; i<n; i++) {
			System.out.print(pa[i] + " ");
		}
		System.out.println();
		for (int i=0; i<n; i++) {
			System.out.print(pb[i] + " ");
		}
		System.out.println();
	}

	private void calculate() {
		if (k<n+1) {
			pa = null;
			return;
		}
		pa = new int[n];
		pb = new int[n];
		// moving a->0 c->1 d->2 b->n-1
		int []idx = new int[n];
		idx[0] = a;
		idx[1] = d;
		idx[2] = c;
		idx[n-1] = b;
		int ii = 1;
		// fill all other indexes
		for (int i=3; i<n-1; i++) {
			while (!(ii!=a && ii!=b && ii!=c && ii!=d)) {
				ii++;
			}
			idx[i] = ii++;
		}
		for (int i=0; i<n; i++) {
			pa[i] = idx[i];
		}
		for (int i=2; i<n; i++) {
			pb[i-2] = idx[i];
		}
		pb[n-2] = a;
		pb[n-1] = d;
	}

	public static void main(String[] args) throws IOException {
		// BufferedReader bin = new BufferedReader(new FileReader("cactus.in"));
		BufferedReader bin = new BufferedReader(
				new InputStreamReader(System.in));
		BearTwoPaths l = new BearTwoPaths();
		l.readData(bin);
		l.calculate();
		l.printRes();
	}
}


// CodeForces Round #673 D competition

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.PriorityQueue;

public class BearTwoPaths {

	int n,k;
	int a,b,c,d;
	int []pa;
	int []pb;

	private void readData(BufferedReader bin) throws IOException {
		String s = bin.readLine();
		String []ss = s.split(" ");
		n = Integer.parseInt(ss[0]);
		k = Integer.parseInt(ss[1]);
		// read t
		s = bin.readLine();
		ss = s.split(" ");
		a = Integer.parseInt(ss[0]);
		b = Integer.parseInt(ss[1]);
		c = Integer.parseInt(ss[2]);
		d = Integer.parseInt(ss[3]);
	}

	void printRes() {
		if (pa==null) {
			System.out.println(-1);
			return;
		}
		for (int i=0; i<n; i++) {
			System.out.print(pa[i] + " ");
		}
		System.out.println();
		for (int i=0; i<n; i++) {
			System.out.print(pb[i] + " ");
		}
		System.out.println();
	}

	private void calculate() {
		if (k<n+1) {
			pa = null;
			return;
		}
		pa = new int[n];
		pb = new int[n];
		// moving a->0 c->1 d->2 b->n-1
		int []idx = new int[n];
		idx[0] = a;
		idx[1] = c;
		idx[n-2] = d;
		idx[n-1] = b;
		int ii = 1;
		// fill all other indexes
		for (int i=2; i<n-2; i++) {
			while (!(ii!=a && ii!=b && ii!=c && ii!=d)) {
				ii++;
			}
			idx[i] = ii++;
		}
		for (int i=0; i<n; i++) {
			pa[i] = idx[i];
			pb[i] = idx[i];
		}
		pb[0] = c;
		pb[1] = a;
		pb[n-2] = b;
		pb[n-1] = d;
	}

	public static void main(String[] args) throws IOException {
		// BufferedReader bin = new BufferedReader(new FileReader("cactus.in"));
		BufferedReader bin = new BufferedReader(
				new InputStreamReader(System.in));
		BearTwoPaths l = new BearTwoPaths();
		l.readData(bin);
		l.calculate();
		l.printRes();
	}
}


// CodeForces Round #673 D competition

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.PriorityQueue;

public class BearTwoPaths {

	int n,k;
	int a,b,c,d;
	int []pa;
	int []pb;

	private void readData(BufferedReader bin) throws IOException {
		String s = bin.readLine();
		String []ss = s.split(" ");
		n = Integer.parseInt(ss[0]);
		k = Integer.parseInt(ss[1]);
		// read t
		s = bin.readLine();
		ss = s.split(" ");
		a = Integer.parseInt(ss[0]);
		b = Integer.parseInt(ss[1]);
		c = Integer.parseInt(ss[2]);
		d = Integer.parseInt(ss[3]);
	}

	void printRes() {
		if (pa==null) {
			System.out.println(-1);
			return;
		}
		for (int i=0; i<n; i++) {
			System.out.print(pa[i] + " ");
		}
		System.out.println();
		for (int i=0; i<n; i++) {
			System.out.print(pb[i] + " ");
		}
		System.out.println();
	}

	private void calculate() {
		if (k<n+1) {
			pa = null;
			return;
		}
		pa = new int[n];
		pb = new int[n];
		// moving a->0 c->1 d->2 b->n-1
		int []idx = new int[n];
		idx[0] = a;
		idx[1] = d;
		idx[n-2] = c;
		idx[n-1] = b;
		int ii = 1;
		// fill all other indexes
		for (int i=2; i<n-2; i++) {
			while (!(ii!=a && ii!=b && ii!=c && ii!=d)) {
				ii++;
			}
			idx[i] = ii++;
		}
		for (int i=0; i<n; i++) {
			pa[i] = idx[i];
			pb[i] = idx[i];
		}
		pb[0] = c;
		pb[1] = a;
		pb[n-2] = b;
		pb[n-1] = d;
	}

	public static void main(String[] args) throws IOException {
		// BufferedReader bin = new BufferedReader(new FileReader("cactus.in"));
		BufferedReader bin = new BufferedReader(
				new InputStreamReader(System.in));
		BearTwoPaths l = new BearTwoPaths();
		l.readData(bin);
		l.calculate();
		l.printRes();
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author zodiacLeo
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        FastPrinter out = new FastPrinter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD
    {
        public void solve(int testNumber, FastScanner in, FastPrinter out)
        {
            int n = in.nextInt();
            int k = in.nextInt();
            if (n <= 5 || k < n - 5 + 1 + 4 + 2)
            {
                out.println(-1);
                return;
            }

            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int d = in.nextInt();
            int[] map = new int[n + 1];
            map[1] = a;
            map[2] = b;
            map[3] = c;
            map[4] = d;
            int now = 1;
            for (int j = 5; j <= n; j++)
            {
                while (now == a || now == b || now == c || now == d)
                {
                    now++;
                }
                map[j] = now;
                now++;
            }
            int[] p1 = new int[n];
            p1[0] = 1;
            p1[n - 1] = 2;
            p1[n - 4] = 4;
            p1[n - 2] = 3;
            now = 5;
            for (int i = 1; i < n; i++)
            {
                if (p1[i] == 0)
                {
                    p1[i] = now;
                    now++;
                }
            }

            int[] p2 = new int[n];
            p2[0] = 3;
            p2[n - 1] = 4;
            p2[1] = 2;
            p2[3] = 1;
            now = 5;
            for (int i = 0; i < n; i++)
            {
                if (p2[i] == 0)
                {
                    p2[i] = now;
                    now++;
                }
            }

            StringBuilder sb = new StringBuilder("");
            for (int i = 0; i < n; i++)
            {
                sb.append(map[p1[i]] + " ");
            }
            sb.append("\n");
            for (int i = 0; i < n; i++)
            {
                sb.append(map[p2[i]] + " ");
            }
            sb.append("\n");
            out.print(sb);
        }

    }

    static class FastScanner
    {
        public BufferedReader br;
        public StringTokenizer st;

        public FastScanner(InputStream is)
        {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public FastScanner(File f)
        {
            try
            {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e)
            {
                e.printStackTrace();
            }
        }

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

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

    }

    static class FastPrinter extends PrintWriter
    {
        public FastPrinter(OutputStream out)
        {
            super(out);
        }

        public FastPrinter(Writer out)
        {
            super(out);
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author zodiacLeo
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        FastPrinter out = new FastPrinter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD
    {
        public void solve(int testNumber, FastScanner in, FastPrinter out)
        {
            int n = in.nextInt();
            int k = in.nextInt();
            if (n <= 4 || k < n + 1)
            {
                out.println(-1);
                return;
            }

            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int d = in.nextInt();
            int[] map = new int[n + 1];
            map[1] = a;
            map[2] = b;
            map[3] = c;
            map[4] = d;
            int now = 1;
            for (int j = 5; j <= n; j++)
            {
                while (now == a || now == b || now == c || now == d)
                {
                    now++;
                }
                map[j] = now;
                now++;
            }
            int[] p1 = new int[n];
            p1[0] = 1;
            p1[n - 1] = 2;
            p1[1] = 3;
            p1[n - 2] = 4;
            now = 5;
            for (int i = 0; i < n; i++)
            {
                if (p1[i] == 0)
                {
                    p1[i] = now;
                    now++;
                }
            }
            int[] p2 = p1.clone();
            int temp = p2[0];
            p2[0] = p2[1];
            p2[1] = temp;

            temp = p2[n - 1];
            p2[n - 1] = p2[n - 2];
            p2[n - 2] = temp;

            StringBuilder sb = new StringBuilder("");
            for (int i = 0; i < n; i++)
            {
                sb.append(map[p1[i]] + " ");
            }
            sb.append("\n");
            for (int i = 0; i < n; i++)
            {
                sb.append(map[p2[i]] + " ");
            }
            sb.append("\n");
            out.print(sb);
        }

    }

    static class FastPrinter extends PrintWriter
    {
        public FastPrinter(OutputStream out)
        {
            super(out);
        }

        public FastPrinter(Writer out)
        {
            super(out);
        }

    }

    static class FastScanner
    {
        public BufferedReader br;
        public StringTokenizer st;

        public FastScanner(InputStream is)
        {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public FastScanner(File f)
        {
            try
            {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e)
            {
                e.printStackTrace();
            }
        }

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

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

    }
}


//package baobab;

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

public class D {

    public static void main(String[] args) {
        DIO io = new DIO();
        try {
            Dsolver solver = new Dsolver(io);
        } finally {
            io.close();
        }
    }

}

class Dsolver {

    public Dsolver(DIO io) {
        io.println(solve(io));
    }

    public String solve(DIO io) {
        int n = io.nextInt();
        int k = io.nextInt();

        if (n < 5) return "-1";
        if (k < (n - 1 + 2)) return "-1";

        StringBuilder first = new StringBuilder();
        StringBuilder second = new StringBuilder();

        int a = io.nextInt();
        int b = io.nextInt();
        int c = io.nextInt();
        int d = io.nextInt();

        boolean[] reserved = new boolean[n+2];
        reserved[a] = true;
        reserved[b] = true;
        reserved[c] = true;
        reserved[d] = true;
        int nextFree = 1;
        while (reserved[nextFree]) nextFree++;

        if (n == 5) {
            first.append(a + " " + c + " " + nextFree + " " + d + " " + b);
            second.append(c + " " + a + " " + nextFree + " " + b + " " + d);
        } else {
            int startLink = nextFree++;
            while (reserved[nextFree]) nextFree++;
            int endLink = nextFree++;
            while (reserved[nextFree]) nextFree++;

            first.append(a + " " + c + " " + startLink + " ");
            second.append(c + " " + a + " " + startLink + " ");
            for (int i=6; i<n; i++) {
                first.append(nextFree + " ");
                second.append(nextFree + " ");
                System.out.println("Lisättiin " + nextFree);
                nextFree++;
                while (reserved[nextFree]) nextFree++;
            }
            second.append(endLink + " " + b + " " + d + " ");
            first.append(endLink + " " + d + " " + b + " ");
        }

        return first.toString() + "\n" + second.toString();
    }
}

class DIO extends PrintWriter {
    private InputStreamReader r;
    private static final int BUFSIZE = 1 << 15;
    private char[] buf;
    private int bufc;
    private int bufi;
    private StringBuilder sb;

    public DIO() {
        super(new BufferedOutputStream(System.out));
        r = new InputStreamReader(System.in);

        buf = new char[BUFSIZE];
        bufc = 0;
        bufi = 0;
        sb = new StringBuilder();
    }

    private void fillBuf() throws IOException {
        bufi = 0;
        bufc = 0;
        while(bufc == 0) {
            bufc = r.read(buf, 0, BUFSIZE);
            if(bufc == -1) {
                bufc = 0;
                return;
            }
        }
    }

    private boolean pumpBuf() throws IOException {
        if(bufi == bufc) {
            fillBuf();
        }
        return bufc != 0;
    }

    private boolean isDelimiter(char c) {
        return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f';
    }

    private void eatDelimiters() throws IOException {
        while(true) {
            if(bufi == bufc) {
                fillBuf();
                if(bufc == 0) throw new RuntimeException("IO: Out of input.");
            }

            if(!isDelimiter(buf[bufi])) break;
            ++bufi;
        }
    }

    public String next() {
        try {
            sb.setLength(0);

            eatDelimiters();
            int start = bufi;

            while(true) {
                if(bufi == bufc) {
                    sb.append(buf, start, bufi - start);
                    fillBuf();
                    start = 0;
                    if(bufc == 0) break;
                }

                if(isDelimiter(buf[bufi])) break;
                ++bufi;
            }

            sb.append(buf, start, bufi - start);

            return sb.toString();
        } catch(IOException e) {
            throw new RuntimeException("IO.next: Caught IOException.");
        }
    }

    public int nextInt() {
        try {
            int ret = 0;

            eatDelimiters();

            boolean positive = true;
            if(buf[bufi] == '-') {
                ++bufi;
                if(!pumpBuf()) throw new RuntimeException("IO.nextInt: Invalid int.");
                positive = false;
            }

            boolean first = true;
            while(true) {
                if(!pumpBuf()) break;
                if(isDelimiter(buf[bufi])) {
                    if(first) throw new RuntimeException("IO.nextInt: Invalid int.");
                    break;
                }
                first = false;

                if(buf[bufi] >= '0' && buf[bufi] <= '9') {
                    if(ret < -214748364) throw new RuntimeException("IO.nextInt: Invalid int.");
                    ret *= 10;
                    ret -= (int)(buf[bufi] - '0');
                    if(ret > 0) throw new RuntimeException("IO.nextInt: Invalid int.");
                } else {
                    throw new RuntimeException("IO.nextInt: Invalid int.");
                }

                ++bufi;
            }

            if(positive) {
                if(ret == -2147483648) throw new RuntimeException("IO.nextInt: Invalid int.");
                ret = -ret;
            }

            return ret;
        } catch(IOException e) {
            throw new RuntimeException("IO.nextInt: Caught IOException.");
        }
    }

    public long nextLong() {
        try {
            long ret = 0;

            eatDelimiters();

            boolean positive = true;
            if(buf[bufi] == '-') {
                ++bufi;
                if(!pumpBuf()) throw new RuntimeException("IO.nextLong: Invalid long.");
                positive = false;
            }

            boolean first = true;
            while(true) {
                if(!pumpBuf()) break;
                if(isDelimiter(buf[bufi])) {
                    if(first) throw new RuntimeException("IO.nextLong: Invalid long.");
                    break;
                }
                first = false;

                if(buf[bufi] >= '0' && buf[bufi] <= '9') {
                    if(ret < -922337203685477580L) throw new RuntimeException("IO.nextLong: Invalid long.");
                    ret *= 10;
                    ret -= (long)(buf[bufi] - '0');
                    if(ret > 0) throw new RuntimeException("IO.nextLong: Invalid long.");
                } else {
                    throw new RuntimeException("IO.nextLong: Invalid long.");
                }

                ++bufi;
            }

            if(positive) {
                if(ret == -9223372036854775808L) throw new RuntimeException("IO.nextLong: Invalid long.");
                ret = -ret;
            }

            return ret;
        } catch(IOException e) {
            throw new RuntimeException("IO.nextLong: Caught IOException.");
        }
    }

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

}


//package baobab;

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

public class D {

    public static void main(String[] args) {
        DIO io = new DIO();
        try {
            Dsolver solver = new Dsolver(io);
        } finally {
            io.close();
        }
    }

}

class Dsolver {

    public Dsolver(DIO io) {
        io.println(solve(io));
    }

    public String solve(DIO io) {
        int n = io.nextInt();
        int k = io.nextInt();

        if (n < 5) return "-1";
        if (k < (n - 1 + 2)) return "-1";

        StringBuilder first = new StringBuilder();
        StringBuilder second = new StringBuilder();

        int a = io.nextInt();
        int b = io.nextInt();
        int c = io.nextInt();
        int d = io.nextInt();

        boolean[] reserved = new boolean[n+2];
        reserved[a] = true;
        reserved[b] = true;
        reserved[c] = true;
        reserved[d] = true;
        int nextFree = 1;
        while (reserved[nextFree]) nextFree++;

        if (n == 5) {
            first.append(a + " " + c + " " + nextFree + " " + d + " " + b);
            second.append(c + " " + a + " " + nextFree + " " + b + " " + d);
        } else {
            int startLink = nextFree++;
            while (reserved[nextFree]) nextFree++;
            int endLink = nextFree++;
            while (reserved[nextFree]) nextFree++;

            first.append(a + " " + c + " " + startLink + " ");
            second.append(c + " " + a + " " + startLink + " ");
            for (int i=6; i<n; i++) {
                first.append(nextFree + " ");
                second.append(nextFree + " ");
                nextFree++;
                while (reserved[nextFree]) nextFree++;
            }
            second.append(endLink + " " + b + " " + d + " ");
            first.append(endLink + " " + d + " " + b + " ");
        }

        return first.toString() + "\n" + second.toString();
    }
}

class DIO extends PrintWriter {
    private InputStreamReader r;
    private static final int BUFSIZE = 1 << 15;
    private char[] buf;
    private int bufc;
    private int bufi;
    private StringBuilder sb;

    public DIO() {
        super(new BufferedOutputStream(System.out));
        r = new InputStreamReader(System.in);

        buf = new char[BUFSIZE];
        bufc = 0;
        bufi = 0;
        sb = new StringBuilder();
    }

    private void fillBuf() throws IOException {
        bufi = 0;
        bufc = 0;
        while(bufc == 0) {
            bufc = r.read(buf, 0, BUFSIZE);
            if(bufc == -1) {
                bufc = 0;
                return;
            }
        }
    }

    private boolean pumpBuf() throws IOException {
        if(bufi == bufc) {
            fillBuf();
        }
        return bufc != 0;
    }

    private boolean isDelimiter(char c) {
        return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f';
    }

    private void eatDelimiters() throws IOException {
        while(true) {
            if(bufi == bufc) {
                fillBuf();
                if(bufc == 0) throw new RuntimeException("IO: Out of input.");
            }

            if(!isDelimiter(buf[bufi])) break;
            ++bufi;
        }
    }

    public String next() {
        try {
            sb.setLength(0);

            eatDelimiters();
            int start = bufi;

            while(true) {
                if(bufi == bufc) {
                    sb.append(buf, start, bufi - start);
                    fillBuf();
                    start = 0;
                    if(bufc == 0) break;
                }

                if(isDelimiter(buf[bufi])) break;
                ++bufi;
            }

            sb.append(buf, start, bufi - start);

            return sb.toString();
        } catch(IOException e) {
            throw new RuntimeException("IO.next: Caught IOException.");
        }
    }

    public int nextInt() {
        try {
            int ret = 0;

            eatDelimiters();

            boolean positive = true;
            if(buf[bufi] == '-') {
                ++bufi;
                if(!pumpBuf()) throw new RuntimeException("IO.nextInt: Invalid int.");
                positive = false;
            }

            boolean first = true;
            while(true) {
                if(!pumpBuf()) break;
                if(isDelimiter(buf[bufi])) {
                    if(first) throw new RuntimeException("IO.nextInt: Invalid int.");
                    break;
                }
                first = false;

                if(buf[bufi] >= '0' && buf[bufi] <= '9') {
                    if(ret < -214748364) throw new RuntimeException("IO.nextInt: Invalid int.");
                    ret *= 10;
                    ret -= (int)(buf[bufi] - '0');
                    if(ret > 0) throw new RuntimeException("IO.nextInt: Invalid int.");
                } else {
                    throw new RuntimeException("IO.nextInt: Invalid int.");
                }

                ++bufi;
            }

            if(positive) {
                if(ret == -2147483648) throw new RuntimeException("IO.nextInt: Invalid int.");
                ret = -ret;
            }

            return ret;
        } catch(IOException e) {
            throw new RuntimeException("IO.nextInt: Caught IOException.");
        }
    }

    public long nextLong() {
        try {
            long ret = 0;

            eatDelimiters();

            boolean positive = true;
            if(buf[bufi] == '-') {
                ++bufi;
                if(!pumpBuf()) throw new RuntimeException("IO.nextLong: Invalid long.");
                positive = false;
            }

            boolean first = true;
            while(true) {
                if(!pumpBuf()) break;
                if(isDelimiter(buf[bufi])) {
                    if(first) throw new RuntimeException("IO.nextLong: Invalid long.");
                    break;
                }
                first = false;

                if(buf[bufi] >= '0' && buf[bufi] <= '9') {
                    if(ret < -922337203685477580L) throw new RuntimeException("IO.nextLong: Invalid long.");
                    ret *= 10;
                    ret -= (long)(buf[bufi] - '0');
                    if(ret > 0) throw new RuntimeException("IO.nextLong: Invalid long.");
                } else {
                    throw new RuntimeException("IO.nextLong: Invalid long.");
                }

                ++bufi;
            }

            if(positive) {
                if(ret == -9223372036854775808L) throw new RuntimeException("IO.nextLong: Invalid long.");
                ret = -ret;
            }

            return ret;
        } catch(IOException e) {
            throw new RuntimeException("IO.nextLong: Caught IOException.");
        }
    }

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

}


import com.sun.org.apache.xml.internal.utils.StringComparable;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    public static void main(String[] args) {
//     Test.testing();
        ConsoleIO io = new ConsoleIO();
        new Main(io).solve();
        io.flush();
    }

    ConsoleIO io;

    Main(ConsoleIO io) {
        this.io = io;
    }

    ArrayList<ArrayList<Integer>> gr;
    boolean[] visit;

    class Pair {
        public Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        public int a; // index
        public int b; // cost
    }

    class Edge {
        public Edge(int u, int v, int c) {
            this.u = u;
            this.v = v;
            this.c = c;
        }

        public int u;
        public int v;
        public int c;
    }

    long MOD = 1_000_000_007;
    int n, m, k;
    int[][] map;
    int move, change, time;

    public void solve() {
        int[] l = io.readIntArray();
        n = l[0];
        k = l[1];
        l = io.readIntArray();
        int a = l[0],b = l[1],c = l[2], d = l[3];
        if (n == 4 || k < n + 1) {
            io.writeLine("-1");
            return;
        }

        int[] res = new int[n];
        res[0] = a;
        res[1] = c;
        res[n-2] = d;
        res[n-1] = b;
        boolean[] used = new boolean[n+1];
        used[a]=used[b] = used[c] = used[d] = true;
        for(int i = 2;i<n-2;i++) {
            for (int j = 1; j < used.length; j++)
                if (!used[j]) {
                    res[i] = j;
                    used[j] = true;
                    break;
                }
        }

        StringBuilder sb = new StringBuilder();
        for(int i = 0;i<res.length;i++){
            if(sb.length()>0)sb.append(' ');
            sb.append(res[i]);
        }
        io.writeLine(sb.toString());

        res[0] = c;
        res[1] = a;
        res[n-2] = b;
        res[n-1] = d;
        sb = new StringBuilder();
        for(int i = 0;i<res.length;i++){
            if(sb.length()>0)sb.append(' ');
            sb.append(res[i]);
        }
        io.writeLine(sb.toString());

    }

    class Brack{
        public Brack(int d){
            this.dir = d;
        }
        public int dir;
        public Brack left;
        public Brack right;
    }

    long gcd(long a, long b) {
        if (a < b) return gcd(b, a);
        if (b == 0) return a;
        return gcd(b, a % b);
    }
}

class ConsoleIO {
    BufferedReader br;
    PrintWriter out;
    public ConsoleIO(){br = new BufferedReader(new InputStreamReader(System.in));out = new PrintWriter(System.out);}
    public void flush(){this.out.close();}
    public void writeLine(String s) {this.out.println(s);}
    public void writeInt(int a) {this.out.print(a);this.out.print(' ');}
    public void writeWord(String s){
        this.out.print(s);
    }
    public int read(char[] buf, int len){try {return br.read(buf,0,len);}catch (Exception ex){ return -1; }}
    public String readLine() {try {return br.readLine();}catch (Exception ex){ return "";}}
    public long readLong() {
        return Long.parseLong(this.readLine());
    }
    public int readInt() {
        return Integer.parseInt(this.readLine().trim());
    }
    public long[] readLongArray() {
        String[]n=this.readLine().trim().split("\\s+");long[]r=new long[n.length];
        for(int i=0;i<n.length;i++)r[i]=Long.parseLong(n[i]);
        return r;
    }
    public int[] readIntArray() {
        String[]n=this.readLine().trim().split("\\s+");int[]r=new int[n.length];
        for(int i=0;i<n.length;i++)r[i]=Integer.parseInt(n[i]);
        return r;
    }
    public void writeIntArray(int[] a) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < a.length; i++) {if (i > 0) sb.append(' ');sb.append(a[i]);}
        this.writeLine(sb.toString());
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class BearAndTwoPaths {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(bf.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		st = new StringTokenizer(bf.readLine());
		int edges = n + 1;
		if (n == 4 || k < edges) {
			System.out.println(-1);
			return;
		}
		int a = Integer.parseInt(st.nextToken());
		int b = Integer.parseInt(st.nextToken());
		int c = Integer.parseInt(st.nextToken());
		int d = Integer.parseInt(st.nextToken());
		ArrayList<Integer> a1 = new ArrayList<Integer>();
		ArrayList<Integer> a2 = new ArrayList<Integer>();
		a1.add(a);
		a1.add(c);
		a2.add(c);
		a2.add(a);
		for (int u = 1; u <= n; u++)
			if (u != a && u != b && u != c && u != d) {
				a1.add(u);
				a2.add(u);
			}
		a1.add(d);
		a1.add(b);
		a2.add(b);
		a2.add(d);
		System.out.print(a1.get(0));
		for (int i = 1; i < a1.size(); i++)
			System.out.print(" " + a1.get(i));
		System.out.println();
		System.out.print(a2.get(0));
		for (int i = 1; i < a2.size(); i++)
			System.out.print(" " + a2.get(i));
		System.out.println();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class BearAndTwoPaths {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(bf.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		st = new StringTokenizer(bf.readLine());
		int edges = n + 1;
		if (n == 4 || k < edges) {
			System.out.println(-1);
			return;
		}
		int a = Integer.parseInt(st.nextToken());
		int b = Integer.parseInt(st.nextToken());
		int c = Integer.parseInt(st.nextToken());
		int d = Integer.parseInt(st.nextToken());
		ArrayList<Integer> a1 = new ArrayList<Integer>();
		ArrayList<Integer> a2 = new ArrayList<Integer>();
		a1.add(a);
		a1.add(c);
		a2.add(c);
		a2.add(a);
		int u = 1;
		for (int i = 0; i < n - 2; i++, u++)
			if (u != a && u != b && u != c && u != d) {
				a1.add(u);
				a2.add(u);
			} else
				i--;
		a1.add(d);
		a1.add(b);
		a2.add(b);
		a2.add(d);
		System.out.print(a1.get(0));
		for (int i = 1; i < a1.size(); i++)
			System.out.print(" " + a1.get(i));
		System.out.println();
		System.out.print(a2.get(0));
		for (int i = 1; i < a2.size(); i++)
			System.out.print(" " + a2.get(i));
		System.out.println();
	}
}


import java.io.*;
import java.util.*;
import java.math.*;
public class Solve4 {
  public static void main(String[] args) {
	MyScanner scanner = new MyScanner();
	PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	int n = scanner.nextInt();
	int k = scanner.nextInt();
	int a = scanner.nextInt();
	int b = scanner.nextInt();
	int c = scanner.nextInt();
	int d = scanner.nextInt();
    int t[] = new int[n+1];
	t[a] = 1;
	t[b] = 1;
	t[c] = 1;
	t[d] = 1;
	if(k <= n || n == 4) {
	  out.println(-1);
	} else {
	  out.print(a + " ");
	  out.print(c + " ");
      for(int i	= 1; i <= n; i++)
        if(t[i] == 0) out.print(i + " ");
	  out.print(d + " ");
	  out.println(b + " ");

	  out.print(c + " ");
	  out.print(a + " ");
      for(int i	= 1; i <= n; i++)
        if(t[i] == 0) out.print(i+ " ");
	  out.print(b + " ");
	  out.println(d + " ");
	}
	out.close();
  }

  public static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

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

      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.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Solutions {
	static Scanner in = new Scanner();
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) throws NumberFormatException, IOException {
		int nodes = in.nextInt();
		int k = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		int d = in.nextInt();
		if (nodes == k || k == nodes - 1) {
			out.append("-1\n");
			out.close();
			return;
		}

		out.print(a + " " + c + " ");
		for (int i = 1; i <= nodes; i++) {
			if (i != a && i != b && i != c && i != d) {
				out.print(i + " ");
			}
		}
		out.print(d + " " + b);
		StringBuilder path2 = new StringBuilder();
		path2.append(c + " " + b + " ");
		for (int i = 1; i <= nodes; i++) {
			if (i != a && i != b && i != c && i != d) {
				path2.append(i + " ");
			}
		}
		path2.append(a + " " + d);
		out.println();
		out.print(path2);

		out.flush();
		out.close();
	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

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

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

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

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

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

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

	}

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Solutions {
	static Scanner in = new Scanner();
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) throws NumberFormatException, IOException {
		int nodes = in.nextInt();
		int k = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		int d = in.nextInt();
		if (nodes == k || k == nodes - 1 || nodes == 4) {
			out.append("-1\n");
			out.close();
			return;
		}

		out.print(a + " " + c + " ");
		for (int i = 1; i <= nodes; i++) {
			if (i != a && i != b && i != c && i != d) {
				out.print(i + " ");
			}
		}
		out.print(d + " " + b);
		StringBuilder path2 = new StringBuilder();
		path2.append(c + " " + a + " ");
		for (int i = 1; i <= nodes; i++) {
			if (i != a && i != b && i != c && i != d) {
				path2.append(i + " ");
			}
		}
		path2.append(b + " " + d);
		out.println();
		out.print(path2);

		out.flush();
		out.close();
	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

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

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

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

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

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

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

	}

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Solutions {
	static Scanner in = new Scanner();
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) throws NumberFormatException, IOException {
		int nodes = in.nextInt();
		int k = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		int d = in.nextInt();
		if (nodes == k || k == nodes - 1) {
			out.append("-1\n");
			out.close();
			return;
		}

		out.print(a + " " + c + " ");
		for (int i = 1; i <= nodes; i++) {
			if (i != a && i != b && i != c && i != d) {
				out.print(i + " ");
			}
		}
		out.print(d + " " + b);
		StringBuilder path2 = new StringBuilder();
		path2.append(c + " " + a + " ");
		for (int i = 1; i <= nodes; i++) {
			if (i != a && i != b && i != c && i != d) {
				path2.append(i + " ");
			}
		}
		path2.append(b + " " + d);
		out.println();
		out.print(path2);

		out.flush();
		out.close();
	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

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

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

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

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

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

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

	}

}


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

public class VKD {

    public static void main(String[] args)throws Exception{
        IO.init(System.in);

        int n, k, a, b, c, d;
        n = IO.nextInt();
        k = IO.nextInt();
        a = IO.nextInt();
        b = IO.nextInt();
        c = IO.nextInt();
        d = IO.nextInt();

        if(k<=n || n==4){ IO.println(-1);return; }
        IO.print(a+" "+c+" ");
        for(int i=1;i<=n;++i){if(i!=a && i!=b && i!=c && i!=d)IO.print(i+" ");}
        IO.print(d+" "+b+"\n");

        IO.print(c+" "+a+" ");
        for(int i=1;i<=n;++i){if(i!=a && i!=b && i!=c && i!=d)IO.print(i+" ");}
        IO.print(b+" "+d+" ");
    }

    static class IO {
        static BufferedReader reader;
        static StringTokenizer tokenizer;

        static void init(InputStream input) {
            reader = new BufferedReader(new InputStreamReader(input) );
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while ( ! tokenizer.hasMoreTokens() ) {
                tokenizer = new StringTokenizer(reader.readLine() );
            }
            return tokenizer.nextToken();
        }

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

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

        static void print(Object ... o){
            for(int i=0;i<o.length;++i){
                System.out.print(o[i]);
            }
        }

        static void println(Object ... o){
            for(int i=0;i<o.length;++i){
                System.out.print(o[i]);
            }
            System.out.println();
        }
    }
}


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

public class VKD {

    public static void main(String[] args)throws Exception{
        IO.init(System.in);

        int n, k, a, b, c, d;
        n = IO.nextInt();
        k = IO.nextInt();
        a = IO.nextInt();
        b = IO.nextInt();
        c = IO.nextInt();
        d = IO.nextInt();

        if(k<=n){ IO.println(-1);return; }
        IO.print(a+" "+c+" ");
        for(int i=1;i<=n;++i){if(i!=a && i!=b && i!=c && i!=d)IO.print(i+" ");}
        IO.print(d+" "+b+"\n");

        IO.print(c+" "+a+" ");
        for(int i=1;i<=n;++i){if(i!=a && i!=b && i!=c && i!=d)IO.print(i+" ");}
        IO.print(b+" "+d+" ");
    }

    static class IO {
        static BufferedReader reader;
        static StringTokenizer tokenizer;

        static void init(InputStream input) {
            reader = new BufferedReader(new InputStreamReader(input) );
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while ( ! tokenizer.hasMoreTokens() ) {
                tokenizer = new StringTokenizer(reader.readLine() );
            }
            return tokenizer.nextToken();
        }

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

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

        static void print(Object ... o){
            for(int i=0;i<o.length;++i){
                System.out.print(o[i]);
            }
        }

        static void println(Object ... o){
            for(int i=0;i<o.length;++i){
                System.out.print(o[i]);
            }
            System.out.println();
        }
    }
}


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

public class VKD {

    public static void main(String[] args)throws Exception{
        IO.init(System.in);
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n, k, a, b, c, d;
        n = IO.nextInt();
        k = IO.nextInt();
        a = IO.nextInt();
        b = IO.nextInt();
        c = IO.nextInt();
        d = IO.nextInt();

        if(k<=n || n==4){ IO.println(-1);return; }
        out.print(a+" "+c+" ");
        for(int i=1;i<=n;++i){if(i!=a && i!=b && i!=c && i!=d)out.print(i+" ");}
        out.print(d+" "+b+"\n");

        out.print(c+" "+a+" ");
        for(int i=1;i<=n;++i){if(i!=a && i!=b && i!=c && i!=d)out.print(i+" ");}
        out.print(b+" "+d+" ");
        out.close();
    }

    static class IO {
        static BufferedReader reader;
        static StringTokenizer tokenizer;

        static void init(InputStream input) {
            reader = new BufferedReader(new InputStreamReader(input) );
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while ( ! tokenizer.hasMoreTokens() ) {
                tokenizer = new StringTokenizer(reader.readLine() );
            }
            return tokenizer.nextToken();
        }

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

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

        static void print(Object ... o){
            for(int i=0;i<o.length;++i){
                System.out.print(o[i]);
            }
        }

        static void println(Object ... o){
            for(int i=0;i<o.length;++i){
                System.out.print(o[i]);
            }
            System.out.println();
        }
    }
}


import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.PrintWriter;

public class BearPath {
    private static final byte[] READ_BUF = new byte[1024];
    private InputStream is;
    private BufferedWriter bw;
    private int bufLen;
    private int bufPtr;

    public static void main(final String[] args) {
        // Instantiate & RUN!!!
        final BearPath instance = new BearPath();
        instance.run(System.in, System.out);
    }

    public void run(final InputStream inputStream, final PrintStream printStream) {
        is = inputStream;
        bw = new BufferedWriter(new PrintWriter(printStream));
        final int n = nextInt();
        final int k = nextInt();
        int a = nextInt();
        int b = nextInt();
        int c = nextInt();
        int d = nextInt();
        int minK = 6 + (n - 5);
        if (k < minK || n == 4) {
            println("-1");
        } else {
            String s1Start = a + " " + c + " ";
            String s2Start = c + " " + a + " ";
            String s1End = b + " " + d;
            String s2End = d + " " + b;
            String middle = "";
            for (int i = 1; i <= n; i++) {
                if ((i == a) || (i == b) || (i == c) || (i == d)) {
                    continue;
                }
                middle += i + " ";
            }
            println(s1Start + middle + s1End);
            println(s2Start + middle + s2End);
        }
        // end of program
        try {
            bw.flush();
            bw.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    // i/o & data utilities
    private void println() throws IOException {
        bw.newLine();
    }

    private void println(final String str) {
        try {
            bw.write(str);
            bw.newLine();
        } catch (Exception e){}
    }

    private int getNextByte() {
        if (bufLen == -1) {
            throw new RuntimeException();
        }
        try {
            if (bufPtr >= bufLen) {
                bufPtr = 0;
                bufLen = is.read(READ_BUF);
                if (bufLen <= 0) {
                    return -1;
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return READ_BUF[bufPtr++];
    }

    private boolean isAsciiChar(int c) {
        return (c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = getNextByte()) != -1 && !isAsciiChar(b)) ;
        return b;
    }

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

    private String next() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (isAsciiChar(b)) {
            sb.appendCodePoint(b);
            b = getNextByte();
        }
        return sb.toString();
    }
}


import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.PrintWriter;

public class BearPath {
    private static final byte[] READ_BUF = new byte[1024];
    private InputStream is;
    private BufferedWriter bw;
    private int bufLen;
    private int bufPtr;

    public static void main(final String[] args) {
        // Instantiate & RUN!!!
        final BearPath instance = new BearPath();
        instance.run(System.in, System.out);
    }

    public void run(final InputStream inputStream, final PrintStream printStream) {
        is = inputStream;
        bw = new BufferedWriter(new PrintWriter(printStream));
        final int n = nextInt();
        final int k = nextInt();
        int a = nextInt();
        int b = nextInt();
        int c = nextInt();
        int d = nextInt();

        if (k < (n+3) || n == 4) {
            println("-1");
        } else {
            String s1Start = a + " " + c + " ";
            String s2Start = c + " " + a + " ";
            String s1End = b + " " + d;
            String s2End = d + " " + b;
            String middle = "";
            for (int i = 1; i <= n; i++) {
                if ((i == a) || (i == b) || (i == c) || (i == d)) {
                    continue;
                }
                middle += i + " ";
            }
            println(s1Start + middle + s1End);
            println(s2Start + middle + s2End);
        }
        // end of program
        try {
            bw.flush();
            bw.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    // i/o & data utilities
    private void println() throws IOException {
        bw.newLine();
    }

    private void println(final String str) {
        try {
            bw.write(str);
            bw.newLine();
        } catch (Exception e){}
    }

    private int getNextByte() {
        if (bufLen == -1) {
            throw new RuntimeException();
        }
        try {
            if (bufPtr >= bufLen) {
                bufPtr = 0;
                bufLen = is.read(READ_BUF);
                if (bufLen <= 0) {
                    return -1;
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return READ_BUF[bufPtr++];
    }

    private boolean isAsciiChar(int c) {
        return (c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = getNextByte()) != -1 && !isAsciiChar(b)) ;
        return b;
    }

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

    private String next() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (isAsciiChar(b)) {
            sb.appendCodePoint(b);
            b = getNextByte();
        }
        return sb.toString();
    }
}


import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.PrintWriter;

public class BearPath {
    private static final byte[] READ_BUF = new byte[1024];
    private InputStream is;
    private BufferedWriter bw;
    private int bufLen;
    private int bufPtr;

    public static void main(final String[] args) {
        // Instantiate & RUN!!!
        final BearPath instance = new BearPath();
        instance.run(System.in, System.out);
    }

    public void run(final InputStream inputStream, final PrintStream printStream) {
        is = inputStream;
        bw = new BufferedWriter(new PrintWriter(printStream));
        final int n = nextInt();
        final int k = nextInt();
        int a = nextInt();
        int b = nextInt();
        int c = nextInt();
        int d = nextInt();
        int minK = 6 + (n - 5);
        if (k < minK || n == 4) {
            println("-1");
        } else {
            String s1Start = a + " " + c + " ";
            String s2Start = c + " " + a + " ";
            String s2End = b + " " + d;
            String s1End = d + " " + b;
            String middle = "";
            for (int i = 1; i <= n; i++) {
                if ((i == a) || (i == b) || (i == c) || (i == d)) {
                    continue;
                }
                middle += i + " ";
            }
            println(s1Start + middle + s1End);
            println(s2Start + middle + s2End);
        }
        // end of program
        try {
            bw.flush();
            bw.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    // i/o & data utilities
    private void println() throws IOException {
        bw.newLine();
    }

    private void println(final String str) {
        try {
            bw.write(str);
            bw.newLine();
        } catch (Exception e){}
    }

    private int getNextByte() {
        if (bufLen == -1) {
            throw new RuntimeException();
        }
        try {
            if (bufPtr >= bufLen) {
                bufPtr = 0;
                bufLen = is.read(READ_BUF);
                if (bufLen <= 0) {
                    return -1;
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return READ_BUF[bufPtr++];
    }

    private boolean isAsciiChar(int c) {
        return (c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = getNextByte()) != -1 && !isAsciiChar(b)) ;
        return b;
    }

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

    private String next() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (isAsciiChar(b)) {
            sb.appendCodePoint(b);
            b = getNextByte();
        }
        return sb.toString();
    }
}


/*****Author: Satyajeet Singh************************************/
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import java.lang.*;
    import java.math.*;
public class Main{
/*********************************************Constants******************************************/
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static long mod=(long)1e9+7;
    static long mod1=998244353;
    static ArrayList<Integer> graph[];
    static int pptr=0,pptrmax=0;
    static String st[];
/*****************************************Solution Begins***************************************/

    public static void main(String args[]) throws Exception{
        int n=pi();
        int k=pi();
        if(k<n+1||n<5){
            out.println(-1);
            clr();
            return;
        }
        int a=pi();
        int b=pi();
        int c=pi();
        int d=pi();
        ArrayList<Integer> mid=new ArrayList<>();
        for(int i=1;i<=n;i++){
            if(a==i||b==i||c==i||d==i)continue;
            mid.add(i);
        }
        out.print(a+" "+c+" ");
        for(int w:mid)out.print(w+" ");
        out.print(d+" "+b);
        out.println();
        out.print(c+" "+a+" ");
        for(int w:mid)out.print(w+" ");
        out.print(b+" "+d);

/****************************************Solution Ends**************************************************/
        clr();
    }
    static void clr(){
        out.flush();
        out.close();
    }
    static void nl() throws Exception{
        pptr=0;
        st=br.readLine().split(" ");
        pptrmax=st.length;
    }
    static void nls() throws Exception{
        pptr=0;
        st=br.readLine().split("");
        pptrmax=st.length;
    }
    static int pi() throws Exception{
        if(pptr==pptrmax)
            nl();
        return Integer.parseInt(st[pptr++]);
    }
    static long pl() throws Exception{
        if(pptr==pptrmax)
            nl();
        return Long.parseLong(st[pptr++]);
    }
    static double pd() throws Exception{
        if(pptr==pptrmax)
            nl();
        return Double.parseDouble(st[pptr++]);
    }
    static String ps() throws Exception{
        if(pptr==pptrmax)
            nl();
        return st[pptr++];
    }
/***************************************Precision Printing**********************************************/
    static void printPrecision(double d){
        DecimalFormat ft = new DecimalFormat("0.00000000000");
        out.println(ft.format(d));
    }
/**************************************Bit Manipulation**************************************************/
    static int countBit(long mask){
        int ans=0;
        while(mask!=0){
            mask&=(mask-1);
            ans++;
        }
        return ans;
    }
/******************************************Graph*********************************************************/
    static void Makegraph(int n){
        graph=new ArrayList[n];
        for(int i=0;i<n;i++)
            graph[i]=new ArrayList<>();
    }
    static void addEdge(int a,int b){
        graph[a].add(b);
    }
    // static void addEdge(int a,int b,int c){
    //     graph[a].add(new Pair(b,c));
    // }
/*********************************************PAIR********************************************************/
    static class Pair{
        int u;
        int v;
        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 String toString() {
            return "[u=" + u + ", v=" + v + "]";
        }
    }
/******************************************Long Pair*******************************************************/
    static class Pairl{
        long u;
        long v;
        public Pairl(long u, long 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) {
            Pairl other = (Pairl) o;
            return u == other.u && v == other.v;
        }
        public String toString() {
            return "[u=" + u + ", v=" + v + "]";
        }
    }
/*****************************************DEBUG***********************************************************/
    public static void debug(Object... o){
        System.out.println(Arrays.deepToString(o));
    }
/************************************MODULAR EXPONENTIATION***********************************************/
    static long modulo(long a,long b,long c){
        long x=1,y=a%c;
        while(b > 0){
            if(b%2 == 1)
                x=(x*y)%c;
            y = (y*y)%c;
            b = b>>1;
        }
        return  x%c;
    }
/********************************************GCD**********************************************************/
    static long gcd(long x, long y){
        if(x==0)
            return y;
        if(y==0)
            return x;
        long r=0, a, b;
        a = (x > y) ? x : y;
        b = (x < y) ? x : y;
        r = b;
        while(a % b != 0){
            r = a % b;
            a = b;
            b = r;
        }
        return r;
    }
}


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

public class D673 {
	static int oo = 987654321;
	public static void main(String[] args) {
		MyScanner scan = new MyScanner();

		int V = scan.nextInt(), E = scan.nextInt();
		if(E < V+1){System.out.println(-1);return;}

		int[] next = new int[V], prev = new int[V];
		int a = scan.nextInt()-1, b = scan.nextInt()-1, c = scan.nextInt()-1, d = scan.nextInt()-1;

		prev[a] = -1;next[b] = -1;
		int pos = a;
		for(int i=0;i<V;i++){
			if(i==V-1)System.out.println((pos+1));
			else System.out.print((pos+1)+" ");
			if(pos==b)break;
			next[pos] = ((pos+1)%V != b)?(pos+1)%V:(pos+2)%V;
			if(next[pos]==a)next[pos]=b;
			prev[next[pos]] = pos;
			pos = next[pos];
		}
		pos = c;
		boolean start = false;
		boolean[] seen = new boolean[V];
		seen[c]=true;
		for(int i=0;i<V;i++){
			if(i==V-1)System.out.println(pos+1);
			else System.out.print((pos+1)+" ");
			if(pos==d)break;
			if(!start){
				if(next[pos]==-1){
					if(next[a]==d)pos=next[d];
					else pos=next[a];
				}
				else if(seen[next[pos]]){
					pos = a;
					start=true;
				}
				else{
					pos = next[pos];
				}
			}else{
				if(seen[next[pos]])pos=d;
				else{
					pos = next[pos];
				}
			}
		}

	}

	private static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		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());
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class D673 {
	static int oo = 987654321;
	public static void main(String[] args) {
		MyScanner scan = new MyScanner();

		int V = scan.nextInt(), E = scan.nextInt();
		if(E < V+1 || V==4){System.out.println(-1);return;}

		int a = scan.nextInt()-1, b = scan.nextInt()-1, c = scan.nextInt()-1, d = scan.nextInt()-1;
		ArrayList<Integer>[] adj = new ArrayList[V];
		for(int i=0;i<V;i++)adj[i] = new ArrayList<>();

		adj[a].add(c);adj[c].add(a);
		adj[b].add(d);adj[d].add(b);

		int first = -1, last = -1, prev=-1;
		for(int i=0;i<V;i++){
			if(i!=a&&i!=b&&i!=c&&i!=d){
				if(first==-1)first=last=i;
				else{
					last = i;
					adj[prev].add(i);
				}
				prev = i;
			}
		}
		adj[a].add(first);adj[c].add(first);
		adj[last].add(b);adj[last].add(d);

		int pos = a;
		boolean[] seen = new boolean[V];seen[a]=true;
		for(int i=0;i<V;i++){
			System.out.print((pos+1)+" ");
			if(pos==a){
				seen[c] = true;pos=c;
			}
			else if (pos==last){
				seen[d] = true;
				pos = d;
			}else{
				for(int j :adj[pos]){
					if(seen[j])continue;
					seen[j]=true;
					pos=j;break;
				}
			}
		}System.out.println();
		pos = c;
		seen = new boolean[V];seen[c] =true;
		for(int i=0;i<V;i++){
			System.out.print((pos+1)+" ");
			if(pos==c){
				seen[a] = true;pos=a;
			}else if (pos==last){
				seen[b] = true;
				pos = b;
			}
			else{
				for(int j :adj[pos]){
					if(seen[j])continue;
					seen[j]=true;
					pos=j;break;
				}
			}
		}System.out.println();
	}

	private static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		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());
		}
	}
}


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

public class D673 {
	static int oo = 987654321;
	public static void main(String[] args) {
		MyScanner scan = new MyScanner();

		int V = scan.nextInt(), E = scan.nextInt();
		if(E < V+1){System.out.println(-1);return;}

		int[] next = new int[V], prev = new int[V];
		int a = scan.nextInt()-1, b = scan.nextInt()-1, c = scan.nextInt()-1, d = scan.nextInt()-1;

		prev[a] = -1;next[b] = -1;
		int pos = a;
		for(int i=0;i<V;i++){
			System.out.print((pos+1)+" ");
			if(pos==b)break;
			next[pos] = ((pos+1)%V != b)?(pos+1)%V:(pos+2)%V;
			if(next[pos]==a)next[pos]=b;
			prev[next[pos]] = pos;
			pos = next[pos];
		}System.out.println();
		pos = c;
		boolean rev = false;
		for(int i=0;i<V;i++){
			System.out.print((pos+1)+" ");
			if(pos==d)break;
			if(!rev){
				if(next[pos]==-1)pos=a;
				else if(next[pos]==d){rev=true;pos=((c-1+V)%V);}
				else pos = next[pos];
			}else{
				pos=prev[pos];
			}
		}System.out.println();

	}

	private static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		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());
		}
	}
}


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

public class D673 {
	static int oo = 987654321;
	public static void main(String[] args) {
		MyScanner scan = new MyScanner();

		int V = scan.nextInt(), E = scan.nextInt();
		if(E < V+1){System.out.println(-1);return;}

		int[] next = new int[V], prev = new int[V];
		int a = scan.nextInt()-1, b = scan.nextInt()-1, c = scan.nextInt()-1, d = scan.nextInt()-1;

		prev[a] = -1;next[b] = -1;
		int pos = a;
		for(int i=0;i<V;i++){
			if(i==V-1)System.out.println((pos+1));
			else System.out.print((pos+1)+" ");
			if(pos==b)break;
			next[pos] = ((pos+1)%V != b)?(pos+1)%V:(pos+2)%V;
			if(next[pos]==a)next[pos]=b;
			prev[next[pos]] = pos;
			pos = next[pos];
		}
		pos = c;
		boolean rev = false;
		for(int i=0;i<V;i++){
			if(i==V-1)System.out.println(pos+1);
			else System.out.print((pos+1)+" ");
			if(pos==d)break;
			if(!rev){
				if(next[pos]==-1)pos=a;
				else if(next[pos]==d){rev=true;pos=((c-1+V)%V);}
				else pos = next[pos];
			}else{
				pos=prev[pos];
			}
		}

	}

	private static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		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());
		}
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Artem Gilmudinov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.readInt();
            int k = in.readInt();
            int a, b, c, d;
            a = in.readInt();
            b = in.readInt();
            c = in.readInt();
            d = in.readInt();
            boolean[] used = new boolean[n + 1];
            used[a] = used[b] = used[c] = used[d] = true;
            if (n < 5) {
                out.println(-1);
                return;
            }
            if (k >= n + 1) {
                ArrayList<Integer> between = new ArrayList<>();
                for (int i = 1; i <= n; i++) {
                    if (!used[i]) {
                        between.add(i);
                    }
                }
                out.print(a + " " + c);
                for (int v : between) {
                    out.print(" " + v);
                }
                out.println(" " + d + " " + b);

                out.print(c + " " + a);
                for (int i = 0; i < between.size(); i++) {
                    out.print(" " + between.get(i));
                }
                out.println(" " + b + " " + d);
            } else {
                out.println(-1);
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Artem Gilmudinov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.readInt();
            int k = in.readInt();
            int a, b, c, d;
            a = in.readInt();
            b = in.readInt();
            c = in.readInt();
            d = in.readInt();
            boolean[] used = new boolean[n + 1];
            used[a] = used[b] = used[c] = used[d] = true;
            if (n <= 5) {
                out.println(-1);
                return;
            }
            if (k >= n + 2) {
                ArrayList<Integer> between = new ArrayList<>();
                for (int i = 1; i <= n; i++) {
                    if (!used[i]) {
                        between.add(i);
                    }
                }
                out.print(a + " " + c);
                for (int v : between) {
                    out.print(" " + v);
                }
                out.println(" " + d + " " + b);

                int fb = between.get(0);
                out.print(c + " " + fb + " " + a);
                for (int i = 1; i < between.size(); i++) {
                    out.print(" " + between.get(i));
                }
                out.println(" " + b + " " + d);
            } else {
                out.println(-1);
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        }

    }
}


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

/**
 * Created by n on 08.05.2016.
 */
public class D673 {

    public static void main(String[] args) {

        MyScanner in = new MyScanner();
        int n = in.nextInt();
        int k = in.nextInt();

        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
        int d = in.nextInt();

        if ((n > 4) && (k > n)) {
            System.out.print(a + " " + c + " ");
            for (int i = 1; i <= n; i++) {
                if ((i != a) && (i != b) && (i != c) && (i != d)) {
                    System.out.print(i + " ");
                }
            }
            System.out.println(d + " " + b);

            System.out.print(c + " " + a + " ");
            for (int i = 1; i <= n; i++) {
                if ((i != a) && (i != b) && (i != c) && (i != d)) {
                    System.out.print(i + " ");
                }
            }
            System.out.println(b + " " + d);
        } else System.out.println(-1);

    }

    private static class MyScanner {

        BufferedReader br;
        StringTokenizer st;

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

        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());
        }
    }
}


	import java.io.*;
	import java.lang.reflect.Array;
	import java.math.BigInteger;
	import java.util.*;

	import java.io.*;
	import java.lang.reflect.Array;
	import java.math.BigInteger;
	import java.util.*;

	public class q5 {

		static TreeSet<Integer> set1,set2;
		static ArrayList<Integer>[] gph;
		static int[] vis;
		static void dfs(int i, int set) {
			vis[i]=1;
			if(set==1) set1.add(i);
			else set2.add(i);
			for(int j:gph[i]) {
				if(vis[j]==0) {
					if(set==1) dfs(j,2);
					else dfs(j,1);
				}
			}
		}

		public static void main(String[] args) throws IOException {

	 		Reader.init(System.in);
	 		PrintWriter out=new PrintWriter(System.out);
			int n=Reader.nextInt();
			int[] arr=new int[n];
			for(int i=0;i<n;i++) arr[i]=Reader.nextInt();
			long[] ans=new long[n+1];
			for(int i=0;i<n;i++) {
				int[] count=new int[n];
				TreeMap<Integer,TreeSet<Integer>> tm=new TreeMap<Integer,TreeSet<Integer>>();
				for(int j=i;j<n;j++) {
					int c=arr[j];
					if(count[c]!=0)
					{tm.get(count[c]).remove(c);
					if(tm.get(count[c]).size()==0) tm.remove(count[c]);}
					count[c]++;
					if(!tm.containsKey(count[c])) tm.put(count[c], new TreeSet<Integer>());
					tm.get(count[c]).add(c);
					int cc= tm.lastKey();
					cc=tm.get(cc).first();
					ans[cc]++;
				}
			}
	 		for(int i=1;i<=n;i++) out.print(ans[i]+" ");
			out.flush();
		}
	}

	class Reader {
	    static BufferedReader reader;
	    static StringTokenizer tokenizer;
	    /** call this method to initialize reader for InputStream */
	    static void init() throws IOException {
	    	 reader = new BufferedReader(
	                 new FileReader("input.txt"));
	    tokenizer = new StringTokenizer("");
	    }
	    static void init(InputStream input) {
	        reader = new BufferedReader(
	                     new InputStreamReader(input) );
	        tokenizer = new StringTokenizer("");
	    }
	    /** get next word */
	    static String nextLine() throws IOException{
	    	return reader.readLine();
	    }
	    static String next() throws IOException {
	        while ( ! tokenizer.hasMoreTokens() ) {
	            //TODO add check for eof if necessary
	            tokenizer = new StringTokenizer(
	                   reader.readLine() );
	        }
	        return tokenizer.nextToken();
	    }
	    static int nextInt() throws IOException {
	        return Integer.parseInt( next() );
	    }
	    static long nextLong() throws IOException {
	        return Long.parseLong( next() );
	    }
	    static double nextDouble() throws IOException {
	        return Double.parseDouble( next() );
	    }
	}


	import java.io.*;
	import java.lang.reflect.Array;
	import java.math.BigInteger;
	import java.util.*;

	import java.io.*;
	import java.lang.reflect.Array;
	import java.math.BigInteger;
	import java.util.*;

	public class q5 {

		static TreeSet<Integer> set1,set2;
		static ArrayList<Integer>[] gph;
		static int[] vis;
		static void dfs(int i, int set) {
			vis[i]=1;
			if(set==1) set1.add(i);
			else set2.add(i);
			for(int j:gph[i]) {
				if(vis[j]==0) {
					if(set==1) dfs(j,2);
					else dfs(j,1);
				}
			}
		}

		public static void main(String[] args) throws IOException {

	 		Reader.init(System.in);
	 		PrintWriter out=new PrintWriter(System.out);
			int n=Reader.nextInt(),k=Reader.nextInt();
			int a=Reader.nextInt(),b=Reader.nextInt(),c=Reader.nextInt(),d=Reader.nextInt();
			if(n==4 || k<n+1) out.println(-1);
			else {
				ArrayList<Integer> arr=new ArrayList<Integer>();
				for(int i=1;i<=n;i++) {
					if(i!=a && i!=b && i!=c && i!=d) arr.add(i);

				}
				out.print(a+" "+c+" ");
				for(int i:arr) out.print(i+" ");
				out.println(d+" "+b);

				out.print(c+" "+a+" ");
				for(int i:arr) out.print(i+" ");
				out.println(b+" "+d);

			}
			out.flush();
		}
	}

	class Reader {
	    static BufferedReader reader;
	    static StringTokenizer tokenizer;
	    /** call this method to initialize reader for InputStream */
	    static void init() throws IOException {
	    	 reader = new BufferedReader(
	                 new FileReader("input.txt"));
	    tokenizer = new StringTokenizer("");
	    }
	    static void init(InputStream input) {
	        reader = new BufferedReader(
	                     new InputStreamReader(input) );
	        tokenizer = new StringTokenizer("");
	    }
	    /** get next word */
	    static String nextLine() throws IOException{
	    	return reader.readLine();
	    }
	    static String next() throws IOException {
	        while ( ! tokenizer.hasMoreTokens() ) {
	            //TODO add check for eof if necessary
	            tokenizer = new StringTokenizer(
	                   reader.readLine() );
	        }
	        return tokenizer.nextToken();
	    }
	    static int nextInt() throws IOException {
	        return Integer.parseInt( next() );
	    }
	    static long nextLong() throws IOException {
	        return Long.parseLong( next() );
	    }
	    static double nextDouble() throws IOException {
	        return Double.parseDouble( next() );
	    }
	}


import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class TestClass {
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String args[] ) throws Exception {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s[] = in.readLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int k = Integer.parseInt(s[1]);
        if(n==4 || k<=n)
        {
        	out.println(-1);
        	out.close();
        	System.exit(0);
        }
        String s1[] = in.readLine().split(" ");
        int a = Integer.parseInt(s1[0]);
        int b = Integer.parseInt(s1[1]);
        int c = Integer.parseInt(s1[2]);
        int d = Integer.parseInt(s1[3]);
        out.print(a+" "+c+" ");
        for(int i=1;i<=n;i++)
        {
        	if(i!=a && i!=b && i!=c && i!=d)
        	{
        		out.print(i+" ");
        	}
        }
        out.println(d+" "+b);

        out.print(c+" "+a+" ");
        for(int i=1;i<=n;i++)
        {
        	if(i!=a && i!=b && i!=c && i!=d)
        	{
        		out.print(i+" ");
        	}
        }
        out.println(b+" "+d);
        out.close();
    }

}


import java.io.IOException;
import java.util.InputMismatchException;

public class BearAndTwoPaths {
    public static void main(String[] args) {
        FasterScanner sc = new FasterScanner();

        int N = sc.nextInt();
        int K = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int D = sc.nextInt();

        if (N <= 4 || K < N + 1) {
        	System.out.println(-1);
        	return;
        }

        int[] ord = new int[N];
        ord[0] = A;
        ord[1] = C;
        ord[N - 2] = D;
        ord[N - 1] = B;
        int idx = 1;
        for (int i = 2; i < N - 2; i++) {
        	while (idx == A || idx == B || idx == C || idx == D) {
        		idx++;
        	}
        	ord[i] = idx++;
        }

        StringBuilder sbv = new StringBuilder();
        for (int i = 0; i < N; i++) {
        	sbv.append(ord[i] + " ");
        }

        StringBuilder sbu = new StringBuilder();
        sbu.append(String.format("%d %d ", ord[1], ord[0]));
        for (int i = 2; i < N - 2; i++) {
        	sbu.append(ord[i] + " ");
        }
        sbu.append(String.format("%d %d", ord[N - 1], ord[N - 2]));

        System.out.println(sbv.toString());
        System.out.println(sbu.toString());
    }

	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.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 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 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 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 int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

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

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

		public long[] nextLongArray(int n, int offset) {
			long[] arr = new long[n + offset];
			for (int i = 0; i < n; i++) {
				arr[i + offset] = nextLong();
			}
			return arr;
		}

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

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


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

public class Div2_351_D {
	public static void main(String[] args) throws IOException {
		BufferedInputStream bis = new BufferedInputStream(System.in);
		BufferedReader br = new BufferedReader(new InputStreamReader(bis));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		String line;
		StringTokenizer st;
		while ((line = br.readLine()) != null && !line.equals("")) {
			st = new StringTokenizer(line);
			int n = Integer.parseInt(st.nextToken());
			int k = Integer.parseInt(st.nextToken());
			int [] vertices = new int[4];
			HashSet <Integer> endpoints = new HashSet<Integer>();
			st = new StringTokenizer(br.readLine());
			for (int i = 0; i < vertices.length; i++) {
				vertices[i] = Integer.parseInt(st.nextToken());
				endpoints.add(vertices[i]);
			}
			if(n == 4 || k <= n)
				out.println(-1);
			else {
				int [] others = new int[n-4];
				out.print(vertices[0]+" "+vertices[2]+" ");
				int last = 0, cnt = 0;
				for(int i = 1;i <= n;i++) {
					if(!endpoints.contains(i)) {
						last = i;
						others[cnt++] = i;
					}
				}
				for(int x:others)
					out.print(x+" ");
				out.println(vertices[3]+" "+vertices[1]);
				out.print(vertices[2]+" "+vertices[0]+" ");
				for(int x:others)
					out.print(x+" ");
				out.println(vertices[1]+" "+vertices[3]);
			}
		}
		out.close();
	}
}


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

public class tmp1 {

    public static InputReader in;
    public static PrintWriter out;
    public static final int MOD = (int) (1e9 + 7);
    public static void main(String[] args) {
        in = new InputReader(System.in);
        out = new PrintWriter(System.out);

        int n = in.nextInt(),
                k = in.nextInt();
        int a = in.nextInt(),
                b = in.nextInt(),
                c = in.nextInt(),
                d = in.nextInt();
        int[] graph = new int[n];
        graph[0] = a;
        graph[1] = c;
        graph[n-2] = b;
        graph[n-1] = d;
        int idx = 0;
        int i = 2;
        while (i < n-2) {
            idx++;
            if(idx == a || idx == b || idx == c || idx == d)
                continue;
            graph[i] = idx;
            i++;
        }
        //out.println(Arrays.toString(graph));
        if(n == 4) {
            out.println(-1);
        } else if(k == n-1) {
            //if(((a == c && b == d) || (a == d && b == c))) {

            //} else
                out.println(-1);
        } else if(k == n) {
            //if(a == c || b == d || a == d || b == c) {

            //} else
                out.println(-1);
        } else if(k > n && n >= 5) {
            for (int j = 0; j < n-2; j++)
                out.print(graph[j] + " ");
            out.println(graph[n-1]+ " " + graph[n-2]);
            out.print(graph[1]+ " " + graph[0] + " ");
            for (int j = 2; j < n; j++)
                out.print(graph[j] + " ");
            out.println();
        } else
            out.println(-1);
        out.close();
    }

    static class Node implements Comparable<Node>{
        int num, freq, idx;

        public Node (int u, int v, int idx) {
            this.num = u;
            this.freq = v;
            this.idx = idx;
        }

        public void print() {
            out.println(num + " " + freq + " " + idx);
        }

        public int compareTo(Node n) {
            if(this.freq == n.freq)
                return Integer.compare(this.num, n.num);
            return Integer.compare(-this.freq, -n.freq);
        }
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

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

        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 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 boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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