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.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;

//Try to test the implementation with some input of your choice
public class GraphTraversal {


	static final int VISITED = 2, EXPLORED = 1, UNVISITED = 0;
	static ArrayList<Integer>[] adjList;
	static boolean[] visited, adjMat[];
	static int V;

	
	public void preTraversal() 
	{

		for(int i = 0; i < V; ++i)		//non-connected
			if(!visited[i])
				dfs(i);					//or bfs
	}
	
//	1.Depth-First Search (DFS)
	static void dfs(int u)				//O(V + E) adjList, O(V^2) adjMat	
	{
		visited[u] = true;

		//for adjacency list
		for(int v: adjList[u])
			if(!visited[v])
				dfs(v);

		//for adjacency matrix
//		for(int i = 0; i < V; ++i)
//			if(adjMat[u][i] && !visited[i])
//				dfs(i);
	}
	
//	2.Breadth-First Search (BFS)
	static void bfs(int s, int t)
	{
		Queue<Integer> q = new LinkedList<Integer>();
		q.add(s);
		visited[s] = true;
		while(!q.isEmpty())
		{
			int u = q.remove();
	
			for(int v: adjList[u])
				if(!visited[v])
				{
					visited[v] = true;
					q.add(v);
				}
		}
	}

//	3.Types of Edges
	static int[] parent, status;
	static void edgeType(int u)
	{
		status[u] = EXPLORED;
		for(int v: adjList[u])
			if(status[v] == UNVISITED)
			{
				System.out.printf("Edge from %d to %d is %s\n", u, v, "tree edge");
				parent[v] = u;
				dfs(v);
			}
			else
				if(status[v] == VISITED)	//cross edges only occur in directed graph
					System.out.printf("Edge from %d to %d is %s\n", u, v, "forwad/cross edge");
				else
					if(parent[u] == v)
						System.out.printf("Edge from %d to %d is %s\n", u, v, "bidirectional edge");
					else
					{
						System.out.printf("Edge from %d to %d is %s\n", u, v, "back edge");
						System.out.println("Cycle!");
					}
		status[u] = VISITED;
	}

//	4.Bipartite Graph Check
	
	static int[] color;
	static boolean bipartitieCheck(int u)
	{
		visited[u] = true;
		for(int v: adjList[u])
			if(color[v] == -1 && !visited[v] )
			{
				color[v] = 1 ^ color[u];
				if(!bipartitieCheck(v))
					return false;
			}
			else
				if(color[v] == color[u])
					return false;
		return true;
	}
	
//	5.Grids - Maze Problem (Reach (R-1, C-1) from (0, 0)
	static char[][] grid;
	static int R, C;
	static int[] dx = new int[]{-1, 1, 0, 0};
	static int[] dy = new int[]{0, 0, -1, 1};

	static boolean valid(int i, int j)
	{
		return i != -1 && j != -1 && i != R && j != C && grid[i][j] == '.';
	}

	static void dfs2(int i, int j)
	{
		grid[i][j] = 'X';
		for(int k = 0; k < 4; ++k)
		{
			int x = i + dx[k], y = j + dy[k];
			if(valid(x, y) && grid[x][y] != 'X')
				dfs2(x, y);
		}
	}


//	6.Topological Sort

	static Stack<Integer> stack = new Stack<Integer>();
	static void toposortDFS(int u)	//don't forget preTraversal	
	{
		visited[u] = true;

		for(int v: adjList[u])
			if(!visited[v])			//if v is explored -> failure
				dfs(v);
		stack.push(u);
	}
	
	static ArrayList<Integer> sortedArray;
	static void toposort()
	{
		int[] p = new int[V];
		sortedArray = new ArrayList<Integer>(V);
		for(int i = 0; i < V; ++i)
			for(int v: adjList[i])
				++p[v];
		Queue<Integer> roots = new LinkedList<Integer>();	//PriorityQueue??

		for(int i = 0; i < V; ++i)
			if(p[i] == 0)
				roots.add(i);
		while(!roots.isEmpty())
		{
			int u = roots.remove();
			sortedArray.add(u);
			for(int v: adjList[u])
				if(--p[v] == 0)
					roots.add(v);
		}
		
		//if p contains non-zero values -> failure
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] edge =new int[n];
		adjList = new ArrayList[n];
		color = new int[n]; Arrays.fill(color, -1);
		for (int i = 0; i < adjList.length; i++) {
			adjList[i] = new ArrayList<>();
		}
		while(m-->0){
			int u = sc.nextInt()-1;
			int v = sc.nextInt()-1;
			adjList[u].add(v);
			adjList[v].add(u);
			edge[u]++;
			edge[v]++;
		}
//		syso
		visited = new boolean[n];
		boolean b = bipartitieCheck(0);
		for (int i = 0; i < visited.length; i++) {
			if(!visited[i])
				b = b&&bipartitieCheck(i);
		}
		if(b){
			PrintWriter out= new PrintWriter(System.out);
			
//			System.out.println("YES");
//			int g1 = 0; int g2= 0;
			ArrayList<Integer> G1 = new ArrayList<>();
			ArrayList<Integer>G2 = new ArrayList<>();
			for (int i = 0; i < edge.length; i++) {
				if(color[i]==-1 && edge[i]>0)
					G1.add(i+1);
				else
					if(edge[i]>0)
						G2.add(i+1);
			}
				out.println(G1.size());
				out.print(G1.get(0));
			for (int i = 1; i < G1.size(); i++) {
					out.print(" "+G1.get(i));
			}
			out.println();
			out.println(G2.size());
			out.println(G2.get(0));
			for (int i = 1; i < G2.size(); i++) {
				out.print(" "+G2.get(i));
			}
//			out.println();
			out.flush();
			out.close();
		}
//		System.out.println(Arrays.toString(color));
		else
			System.out.println(-1);
	}
	
	
	
	
}