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.io.*;
    import java.io.IOException;
    import java.util.*;
    //import javafx.util.Pair; 
    //import java.util.concurrent.LinkedBlockingDeque;
    
    
    
    //import sun.net.www.content.audio.wav;
    
    import java.text.DecimalFormat;
    
   public  class Codeforces {
        
        public static long mod = (long)Math.pow(10, 9)+7 ;
        public static double epsilon=0.00000000008854;//value of epsilon
        public static InputReader sc = new InputReader(System.in);
        public static PrintWriter pw = new PrintWriter(System.out);
        
        
        
        public static boolean hieghtBfs(int r,int h[],ArrayList<ArrayList <Integer>> a,int vis[]){/// top to bottom
            Deque<Integer> q=new LinkedList<>();
            q.add(r);
            int c=1;
            //p[r]=-1;
            vis[r]=1;
            h[r]=c;
            boolean pos=true;
            while(q.size()>0){
                int l=q.size();
                while(l-->0){
                    int v=q.remove();
                    
                    for(int i=0;i<a.get(v).size();i++){
                        int u=a.get(v).get(i);
                        if(vis[u]==0){
                            //pw.print(u+" ");
                            //p[u]=v;
                            vis[u]=1;
                            h[u]=c+1;
                            q.add(u);
                        }
                        else{
                            if((h[u]&1)==(h[v]&1)){
                                return false;
                            }
                            
                        }
                    }
                }
                //pw.print("\n");
                c++;
            }
            return pos;
        }
        
        
        public static ArrayList<ArrayList <Integer>> GetGraph(int n,int m){
            ArrayList<ArrayList <Integer>> a=new ArrayList<>();
            for(int i=0;i<n;i++){
                a.add(new ArrayList<>());
            }
            for(int i=0;i<m;i++){
                int u=sc.nextInt()-1;
                int v=sc.nextInt()-1;
                a.get(u).add(v);
                a.get(v).add(u);
            } 
            return a;
        }
        
        public static void main(String[] args) {
            // code starts..
            int n=sc.nextInt();
            int m=sc.nextInt();
            ArrayList<ArrayList<Integer>> a=GetGraph(n, m);
            ArrayList<Integer> h1=new ArrayList<>();
            ArrayList<Integer> h2=new ArrayList<>();
            int vis[]=new int[n];
            int f=0;
            int h[]=new int[n];
            for(int i=0;i<n;i++){
                if(vis[i]==0&&a.get(i).size()>0){
                    if(!hieghtBfs(i, h, a, vis)){
                       f=1;
                       break; 
                    }
                }
            }
            for(int i=0;i<n;i++){
                if(h[i]>0){
                    if((h[i]&1)==1)
                    h1.add(i+1);
                    else h2.add(i+1);
                }
            }
            StringBuilder out=new StringBuilder();
            if(f==0&&h1.size()>0&&h2.size()>0){
                out.append(h1.size()+"\n");
                for(int i=0;i<h1.size();i++){
                    out.append(h1.get(i)+" ");
                }
                out.append("\n");
                out.append(h2.size()+"\n");
                for(int i=0;i<h2.size();i++){
                    out.append(h2.get(i)+" ");
                }
                pw.println(out);
                //pw.print("\n");
            }
            else pw.println("-1");
            
                
            // Code ends...
            pw.flush();
            pw.close();
        }
        public static Comparator<Integer> C(){
            return 
            new Comparator<Integer>() {
                @Override
                public int compare(Integer o1, Integer o2) {
                    return o2.compareTo(o1);//for descending
                }
            };
        }
        public static Comparator<Pair> di(){
            return 
            new Comparator<Pair>() {
                @Override
                public int compare(Pair o1, Pair o2) {
                    Long a=o1.j;
                    Long b=o2.j;
                    return a.compareTo(b);//ascending
                }
            };
        }
        static class tripletL implements Comparable<tripletL> {
            Long x, y, z;
    
            tripletL(long x, long y, long z) {
                this.x = x;
                this.y = y;
                this.z = z;
            }
    
            public int compareTo(tripletL o) {
                int result = x.compareTo(o.x);
                if (result == 0)
                    result = y.compareTo(o.y);
                if (result == 0)
                    result = z.compareTo(o.z);
    
                return result;
            }
    
            public boolean equlas(Object o) {
                if (o instanceof tripletL) {
                    tripletL p = (tripletL) o;
                    return (x - p.x == 0) && (y - p.y ==0 ) && (z - p.z == 0);
                }
                return false;
            }
    
            public String toString() {
                return x + " " + y + " " + z;
            }
    
            public int hashCode() {
                return new Long(x).hashCode() * 31 + new Long(y).hashCode() + new Long(z).hashCode();
            }
        }
        public static String Doubleformate(double a,int n){
            String s="";
            while(n-->0){
                s+='0';
            }
            DecimalFormat f =new DecimalFormat("#0."+s);
            return f.format(a);
        }
    
        public static Comparator<Integer[]> column(int i){
            return 
            new Comparator<Integer[]>() {
                @Override
                public int compare(Integer[] o1, Integer[] o2) {
                // return o1[i].compareTo(o2[i]);//for ascending
                    return o2[i].compareTo(o1[i]);//for descending
                }
            };
        }
        public static Comparator<Long[]> column1(int i){
            return 
            new Comparator<Long[]>() {
                @Override
                public int compare(Long[] o1, Long[] o2) {
                    return o1[i].compareTo(o2[i]);//for ascending
                    //return o2[i].compareTo(o1[i]);//for descending
                }
            };
        }
        public static Comparator<Integer[]> pair(){
            return 
            new Comparator<Integer[]>() {
                @Override
                public int compare(Integer[] o1, Integer[] o2) {
                    int result=o1[0].compareTo(o2[0]);
                    if(result==0)
                    result=o1[1].compareTo(o2[1]);
                    return result;
                }
            };
        }
        public static Comparator<Integer[]> Triplet(){
            return 
            new Comparator<Integer[]>() {
                @Override
                public int compare(Integer[] o1, Integer[] o2) {
                
                        for(int i=0;i<3;i++){
                            for(int j=i+1;j<3;j++){
                                for(int k=0;k<3;k++){
                                    for(int p=k+1;p<3;p++){
                                        if((o1[i]==o2[k]&&o1[j]==o2[p])||(o1[j]==o2[k]&&o1[i]==o2[p])){
    
                                        }
                                    }
                                }
                            }
                        }
                        int result=o1[0].compareTo(o2[0]);
                        if(result==0)
                        result=o1[1].compareTo(o2[1]);
                        if(result==0)
                        result=o1[2].compareTo(o2[2]);
                        return result;
                }
            };
        }
        
        
        public static String reverseString(String s){
            StringBuilder input1 = new StringBuilder(); 
            input1.append(s);  
            input1 = input1.reverse();
            return input1.toString();
        }
        public static int[] scanArray(int n){
            int a[]=new int [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextInt();
    
            return a;
        }
        public static long[] scanLongArray(int n){
            long a[]=new long [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextLong();
    
            return a;
        }
        public static String [] scanStrings(int n){
            String a[]=new String [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextLine();
    
            return a;
        }
        
    }
    class Pair{
        int i;
        long j;
        Pair(int a,long b){
            i=a;
            j=b;
        }
    }
    class InputReader {
    
            private final InputStream stream;
            private final 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 String nextLine() {
                int c = snext();
                while (isSpaceChar(c))
                    c = snext();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = snext();
                } while (!isEndOfLine(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;
            }
    
            private boolean isEndOfLine(int c) {
                return c == '\n' || c == '\r' || c == -1;
            }
    
            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        }