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.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.stream.Collectors;

public class C_NP_Hard_Problem {
    // A connected component with valid vertex cover.
    static class ConnectedComponent {
        Set<Integer> partA;
        Set<Integer> partB;
        boolean switched = false;
        boolean merged = false;

        ConnectedComponent() {
            partA = new HashSet<>();
            partB = new HashSet<>();
        }

        ConnectedComponent(int u, int v) {
            partA = new HashSet<>();
            partB = new HashSet<>();
            partA.add(u);
            partB.add(v);
        }

        /**
         * v, the vertex index to check. -1, not found. 0 in partA 1 in partB Note:
         * switched switch the part result
         */
        int onWhichParty(int v) {
            int owner = -1;
            if (partA.contains(v)) {
                owner = 0;
            }
            if (partB.contains(v)) {
                owner = 1;
            }
            if (owner == -1) {
                return -1;
            }
            return switched ? 1 - owner : owner;
        }

        boolean verticesSamePart(int v, int u) {
            return (partA.contains(v) && partA.contains(u)) || (partB.contains(v) && partB.contains(u));
        }

        void mergeWith(ConnectedComponent b) {
            b.merged = true;
            if (this.switched != b.switched) {
                this.partA.addAll(b.partB);
                this.partB.addAll(b.partA);
                return;
            }
            this.partA.addAll(b.partA);
            this.partB.addAll(b.partB);
        }

        boolean contains(Integer v) {
            return partA.contains(v) || partB.contains(v);
        }

        void switchParts() {
            switched = !switched;
        }

        List<Integer> allVertices() {
           List<Integer> v = new ArrayList<Integer>(partA);
           v.addAll(partB);
           return v;
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();

        List<ConnectedComponent> components = new ArrayList<>();
        Map<Integer, Integer> vertexToCompMap = new HashMap<>();


        for (int i = 0; i < m; i++) {
            int u = sc.nextInt();
            int v = sc.nextInt();
            // Both vertices are alreaddy in some components
            if (vertexToCompMap.containsKey(u) && vertexToCompMap.containsKey(v)) {
                int vtU = vertexToCompMap.get(u);
                int vtV = vertexToCompMap.get(v);
                // Vertices on same component,
                // If they are in the same part, there is no solution
                // If thy are in different parts, continue check next edge.
                if (vtU == vtV) {
                    if (components.get(vtU).verticesSamePart(v, u)) {
                        noSolution();
                        sc.close();
                        return;
                    }
                    continue;
                }
                // Vertices from different componet, merge them. Do switch properly
                if (components.get(vtU).onWhichParty(u) == components.get(vtV).onWhichParty(v)) {
                    components.get(vtV).switchParts();
                }
                int smaller = Math.min(vtU, vtV);
                int larger = Math.max(vtU, vtV);
                components.get(smaller).mergeWith(components.get(larger));
                // Update components.get(larger) indices
                List<Integer> allV = components.get(larger).allVertices();
                for (int j = 0; j < allV.size(); j++) {
                   vertexToCompMap.put(allV.get(j), smaller);
                }
                continue;
            }
            // If neither is in any components, create a new component.
            if (!vertexToCompMap.containsKey(u) && !vertexToCompMap.containsKey(v)) {
                vertexToCompMap.put(u, components.size());
                vertexToCompMap.put(v, components.size());
                ConnectedComponent a = new ConnectedComponent(u, v);
                components.add(a);
                continue;
            }
            // Now one in component, the other one is not
            ConnectedComponent cc = null;
            int ccIdx = -1;
            int vToAdd = -1;
            int vInCc = -1;
            if(vertexToCompMap.containsKey(u)) {
                ccIdx = vertexToCompMap.get(u);
                cc = components.get(ccIdx);
                vInCc = u;
                vToAdd = v;
            }

            // assert, else
            if(vertexToCompMap.containsKey(v)) {
                ccIdx = vertexToCompMap.get(v);
                cc = components.get(ccIdx);
                vInCc = v;
                vToAdd = u;
            }
            vertexToCompMap.put(vToAdd, ccIdx);

            if(cc.partA.contains(vInCc)) {
                cc.partB.add(vToAdd);
            }
            // assert ,else 
            if(cc.partB.contains(vInCc)) {
                cc.partA.add(vToAdd);
            }


        }
        sc.close();

        // Merge all things (if not merged) to 0
        for (int i = 1; i < components.size(); i++) {
            if(components.get(i).merged) {
                continue;
            }
            components.get(0).mergeWith(components.get(i));
        }

        printPerson(components.get(0).partA);
        printPerson(components.get(0).partB);
    }

    static void printPerson(Set<Integer> person) {
        System.out.println(person.size());
        System.out.println(new ArrayList<>(person).stream().map(i -> i.toString()).collect(Collectors.joining(" ")));
    }

    static void noSolution() {
        System.out.println(-1);
    }
}