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
import sys, math
input = sys.stdin.readline

def getInts():
    return [int(s) for s in input().split()]

def getInt():
    return int(input())

def getStrs():
    return [s for s in input().split()]

def getStr():
    return input().strip()

def listStr():
    return list(input().strip())

import collections as col
import math
from types import GeneratorType


def solve():
    def bootstrap(f, stack=[]):
        def wrappedfunc(*args, **kwargs):
            if stack:
                return f(*args, **kwargs)
            else:
                to = f(*args, **kwargs)
                while True:
                    if type(to) is GeneratorType:
                        stack.append(to)
                        to = next(to)
                    else:
                        stack.pop()
                        if not stack:
                            break
                        to = stack[-1].send(to)
                return to
        return wrappedfunc
    
    @bootstrap
    def dfs(graph,visited,node,visited_dict):
        if node not in visited:
            visited.append(node)
            visited_dict[node] = 1
        for neighbour in graph[node]:
            if neighbour not in visited_dict:
                yield dfs(graph,visited,neighbour,visited_dict)
        yield visited
    
    @bootstrap
    def bfs(graph,visited,node,queue,visited_dict):
        level = 1
        visited.append((node,level))
        visited_dict[node] = 1
        queue.append((node,level))
        queue = col.deque(queue)
        while queue:
            s, level = queue.popleft()
            for neighbour in graph[s]:
                if neighbour not in visited_dict:
                    visited.append((neighbour,level+1))
                    visited_dict[neighbour] = 1
                    queue.append((neighbour,level+1))
        yield visited
    
    N, M = getInts()
    graph = col.defaultdict(set)
    edges = []
    for n in range(M):
        U, V = getInts()
        #how can I avoid putting the edges I don't need in?
        graph[U].add(V)
        graph[V].add(U)
        edges.append((U,V))
    #find connected components first using dfs
    nodes = set([j+1 for j in range(N)])
    connected_components = []
    while nodes:
        node = next(iter(nodes))
        visited = dfs(graph,[],node,{})
        for node in visited:
            nodes.remove(node)
        connected_components.append(visited)
    visited = []
    #print(connected_components)
    #now we bfs each of the connected components
    dict_A, dict_B = col.defaultdict(int), col.defaultdict(int)
    A, B = [], []
    for comp in connected_components:
        if len(comp) == 1:
            continue
        visited = bfs(graph,[],comp[0],[],{})
        for node, level in visited:
            if level % 2 == 0:
                dict_A[node] = node
                A.append(node)
            else:
                dict_B[node] = node
                B.append(node)
    for U,V in edges:
        if (U in dict_A and V in dict_A) or (U in dict_B and V in dict_B):
            print(-1)
            return
    print(len(A))
    print(*A)
    print(len(B))
    print(*B)
    return
    
#for _ in range(getInt()):
solve()
    

