Problem: Recently, Pari and Arya did some research about NP-Hard problems and they found the minimum vertex cover problem very interesting.

Suppose the graph G is given. Subset A of its vertices is called a vertex cover of this graph, if for each edge uv there is at least one endpoint of it in this set, i.e. <image> or <image> (or both).

Pari and Arya have won a great undirected graph as an award in a team contest. Now they have to split it in two parts, but both of them want their parts of the graph to be a vertex cover.

They have agreed to give you their graph and you need to find two disjoint subsets of its vertices A and B, such that both A and B are vertex cover or claim it's impossible. Each vertex should be given to no more than one of the friends (or you can even keep it for yourself).

Input

The first line of the input contains two integers n and m (2 ≤ n ≤ 100 000, 1 ≤ m ≤ 100 000) — the number of vertices and the number of edges in the prize graph, respectively.

Each of the next m lines contains a pair of integers ui and vi (1 ≤ ui, vi ≤ n), denoting an undirected edge between ui and vi. It's guaranteed the graph won't contain any self-loops or multiple edges.

Output

If it's impossible to split the graph between Pari and Arya as they expect, print "-1" (without quotes).

If there are two disjoint sets of vertices, such that both sets are vertex cover, print their descriptions. Each description must contain two lines. The first line contains a single integer k denoting the number of vertices in that vertex cover, and the second line contains k integers — the indices of vertices. Note that because of m ≥ 1, vertex cover cannot be empty.

Examples

Input

4 2
1 2
2 3


Output

1
2 
2
1 3 


Input

3 3
1 2
2 3
1 3


Output

-1

Note

In the first sample, you can give the vertex number 2 to Arya and vertices numbered 1 and 3 to Pari and keep vertex number 4 for yourself (or give it someone, if you wish).

In the second sample, there is no way to satisfy both Pari and Arya.

Solution (in JAVA):

Solution:
    import java.lang.reflect.Array;
    import java.util.Scanner;
    import java.io.*;
    import java.util.*;
    import java.math.*;
    import java.lang.*;
    import static java.lang.Math.*;
    public class main implements Runnable {

        static ArrayList<Integer> adj[];

        static void Check2(int n) {
            adj = new ArrayList[n + 1];
            for (int i = 0; i <= n; i++) {
                adj[i] = new ArrayList<>();
            }

        }
        static void add(int i, int j) {
            adj[i].add(j);
            adj[j].add(i);
        }



        public static void main(String[] args) {
            new Thread(null, new main(), "Check2", 1 << 26).start();// to increse stack size in java
        }

        static long mod = (long) (1e9 + 7);
        public void run() {
                                /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
            //Scanner in=new Scanner(System.in);

            InputReader in = new InputReader(System.in);
            PrintWriter w = new PrintWriter(System.out);

            int n=in.nextInt();
            int m=in.nextInt();
            Check2(n);
            for(int i=0;i<m;i++){
                add(in.nextInt(),in.nextInt());
            }
            int lvl[]=new int[n+1];
            int v[]=new int[n+1];
            Arrays.fill(lvl,-1);
            for(int i=1;i<=n;i++){
                if(v[i]==0){
                    bfs(i,v,n,lvl);
                }
            }
     //       for(int i=1;i<=n;i++)w.print(lvl[i]+" ");
            if(flag)w.println(-1);
            else{
                ArrayList <Integer> list1=new ArrayList<>();
                ArrayList <Integer> list2=new ArrayList<>();

                for(int i=1;i<=n;i++){
                    if(lvl[i]==0&&adj[i].size()>=1){
                        list1.add(i);
                    }
                    else if(lvl[i]==1&&adj[i].size()>=1){
                        list2.add(i);
                    }
                }
                w.println(list1.size());
                for(Integer ne:list1)w.print(ne+" ");
                w.println();
                w.println(list2.size());
                for(Integer ne:list2)w.print(ne+" ");


            }




            w.close();
        }

        static boolean flag;
        static void bfs(int i,int v[],int n,int lvl[]){

            Queue <Integer> q=new LinkedList<>();
            Queue <Integer> q2=new LinkedList<>();
            q.add(i);
            q2.add(0);
            lvl[i]=0;
            v[i]=1;
            while (!q.isEmpty()){

                int r=q.poll();
                int lv=q2.poll();

                for(Integer ne:adj[r])
                {
                    if(lvl[ne]==-1){
                        lvl[ne]=lv^1;
                        v[ne]=1;
                        q.add(ne);
                        q2.add(lv^1);
                    }
                    else {

                        if(lvl[ne]!=(lv^1)&&ne!=r)flag=true;
                    }
                }

            }

        }





        static class pair {

            int a,b;
            pair(int x,int y){
                a=x;
                b=y;
            }

        }





        static long power(long x,long y){
            if(y==0)return 1%mod;
            if(y==1)return x%mod;


            long res=1;
            x=x%mod;
            while(y>0){


                if((y%2)!=0){
                    res=(res*x)%mod;
                }


                y=y/2;
                x=(x*x)%mod;
            }


            return res;



        }


        static  int gcd(int a,int b){

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

        static  void sev(int a[],int n){

            for(int i=2;i<=n;i++)a[i]=i;
            for(int i=2;i<=n;i++){

                if(a[i]!=0){
                    for(int j=2*i;j<=n;){

                        a[j]=0;
                        j=j+i;
                    }
                }

            }

        }



        static class node{

            int y;
            int val;

            node(int a,int b){

                y=a;
                val=b;

            }


        }

        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 String nextLine()
            {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                String str = "";
                try
                {
                    str = br.readLine();
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
                return str;
            }
            public int nextInt()
            {
                int c = read();

                while(isSpaceChar(c))
                    c = read();

                int sgn = 1;

                if (c == '-')
                {
                    sgn = -1;
                    c = read();
                }

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

                return res * sgn;
            }

            public long nextLong()
            {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-')
                {
                    sgn = -1;
                    c = read();
                }
                long res = 0;

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

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

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

            public String next()
            {
                return readString();
            }

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







    }