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. <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/01df7772bf62e4ead52b462423b3d53890cdd820.png" style="max-width: 100.0%;max-height: 100.0%;"/> or <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/4a270f9b8acd044f93b92f335e44798f6c60929d.png" style="max-width: 100.0%;max-height: 100.0%;"/> (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).
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 *u*<sub class="lower-index">*i*</sub> and *v*<sub class="lower-index">*i*</sub> (1  ≤  *u*<sub class="lower-index">*i*</sub>,  *v*<sub class="lower-index">*i*</sub>  ≤  *n*), denoting an undirected edge between *u*<sub class="lower-index">*i*</sub> and *v*<sub class="lower-index">*i*</sub>. It's guaranteed the graph won't contain any self-loops or multiple edges.
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.
4 2
1 2
2 3
1
2 
2
1 3 
3 3
1 2
2 3
1 3
-1
5 7
3 2
5 4
3 4
1 3
1 5
1 4
2 5
-1
10 11
4 10
8 10
2 3
2 4
7 1
8 5
2 8
7 2
1 2
2 9
6 8
-1
10 9
2 5
2 4
2 7
2 9
2 3
2 8
2 6
2 10
2 1
1
2 
9
1 5 4 7 9 3 8 6 10 
10 16
6 10
5 2
6 4
6 8
5 3
5 4
6 2
5 9
5 7
5 1
6 9
5 8
5 10
6 1
6 7
6 3
2
5 6 
8
1 2 10 4 8 9 7 3 
10 17
5 1
8 1
2 1
2 6
3 1
5 7
3 7
8 6
4 7
2 7
9 7
10 7
3 6
4 1
9 1
8 7
10 1
7
5 3 2 8 4 9 10 
3
1 7 6 
10 15
5 9
7 8
2 9
1 9
3 8
3 9
5 8
1 8
6 9
7 9
4 8
4 9
10 9
10 8
6 8
2
9 8 
8
1 5 7 3 4 10 6 2 
10 9
4 9
1 9
10 9
2 9
3 9
6 9
5 9
7 9
8 9
1
9 
9
1 4 10 2 3 6 5 7 8 
2 1
1 2
1
2 
1
1 
10 10
6 4
9 1
3 6
6 7
4 2
9 6
8 6
5 7
1 4
6 10
6
9 4 3 7 8 10 
4
1 6 2 5 
20 22
20 8
1 3
3 18
14 7
19 6
7 20
14 8
8 10
2 5
11 2
4 19
14 2
7 11
15 1
12 15
7 6
11 13
1 16
9 12
1 19
17 3
11 20
-1
20 22
3 18
9 19
6 15
7 1
16 8
18 7
12 3
18 4
9 15
20 1
4 2
6 7
14 2
7 15
7 10
8 1
13 6
9 7
11 8
2 6
18 5
17 15
-1
1000 1
839 771
1
839 
1
771 
1000 1
195 788
1
788 
1
195 
100000 1
42833 64396
1
64396 
1
42833 
100000 1
26257 21752
1
26257 
1
21752 
5 5
1 2
2 3
3 4
4 5
5 1
-1
from collections import defaultdict

# Input the number of vertices and edges
n, m = map(int, input().split())

# Create a list to store the edges and a dictionary to store the degree of each vertex
edges = []
degree = defaultdict(int)

# Input the edges and update the degree of each vertex
for i in range(m):
    u, v = map(int, input().split())
    edges.append((u, v))
    degree[u] += 1
    degree[v] += 1

# Create a set to store the vertex cover
vertex_cover = set()

# Iterate until all edges have been removed
while edges:
    # Choose an arbitrary vertex
    vertex = edges[0][0] if degree[edges[0][0]] <= degree[edges[0][1]] else edges[0][1]
    # Add the vertex to the vertex cover
    vertex_cover.add(vertex)
    # Remove all edges adjacent to the vertex
    edges = [(u, v) for u, v in edges if u != vertex and v != vertex]
    # Decrement the degree of the adjacent vertices
    degree[vertex] = 0
    for u, v in edges:
        degree[u] -= 1
        degree[v] -= 1

# Create two disjoint sets A and B
A = set(vertex_cover)
B = set()

# Iterate over the vertices
for vertex in range(1, n+1):
    # If the vertex is not in the vertex cover, add it to B
    if vertex not in vertex_cover:
        B.add(vertex)

# Check if both A and B are vertex covers
for u, v in edges:
    if u not in A and u not in B and v not in A and v not in B:
        print(-1)
        exit()

# Print the vertex covers
print(len(A))
print(" ".join(map(str, A)))
print(len(B))
print(" ".join(map(str, B)))
