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

def dfs(g,n,visited,co,col):
    stack = [] 
    stack.append(n)  
    while (len(stack)):  
        s = stack[-1]  
        stack.pop() 
        if (s not in visited):  
            co[s] = col%2 + 1
            col = col%2 + 1
            visited.add(s)
        for node in g[s]:
            if(node in visited and co[s] == co[node]):
                print(-1)
                exit(0)
            if (node not in visited):  
                stack.append(node)
    return co

def DFS(g,n):
    visited = set()
    co = {i:0 for i in range(1,n+1)}
    for i in range(1,n+1):
        if(i not in visited):
            dfs(g,i,visited,co,0)
    return co

visited = set()
n,m = map(int,input().split())
g = defaultdict(list)
for _ in range(m):
    x,y = map(int,input().split())
    g[x].append(y)
    g[y].append(x)
    
co = DFS(g,n)
o,e = [],[]
for k in co:
    if(co[k]==2):e.append(k)
    if(co[k]==1):o.append(k)
print(len(o))
print(*o)
print(len(e))
print(*e)
