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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18L + 5;
long long gcd(unsigned long long x, unsigned long long y) {
  if (x == 0) return y;
  return gcd(y % x, x);
}
long long gcdExtended(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 0;
    *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
unsigned long long findGCD(vector<unsigned long long> &v) {
  unsigned long long result = v[0];
  for (long long i = 1; i < v.size(); i++) {
    result = gcd(v[i], result);
    if (result == 1) {
      return 1;
    }
  }
  return result;
}
long long lcm(long long a, long long b) { return ((a * b) / gcd(a, b)); }
bool sortbysec(long long a, long long b) { return (a > b); }
vector<long long> primeFactors(long long n) {
  vector<long long> ans;
  while (n % 2 == 0) {
    ans.push_back(2);
    n = n / 2;
  }
  for (long long i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      ans.push_back(i);
      n = n / i;
    }
  }
  if (n > 2) ans.push_back(n);
  return ans;
}
vector<long long> all_prime(long long n) {
  vector<long long> sieve(n + 1, 0);
  for (long long x = 2; x <= n; x++) {
    if (sieve[x]) continue;
    for (int u = 2 * x; u <= n; u += x) {
      if (sieve[u] == 0) {
        sieve[u] = x;
      }
    }
  }
  return sieve;
}
long long power(long long x, long long n) {
  if (n == 0) return 1;
  long long temp = power(x, n / 2);
  if (n % 2 == 0)
    return temp * temp;
  else
    return x * temp * temp;
}
unsigned long long powerper(unsigned long long x, long long y, long long p) {
  unsigned long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
unsigned long long modInverse(unsigned long long n, long long p) {
  return powerper(n, p - 2, p);
}
unsigned long long nCrModPFermat(unsigned long long n, long long r, long long p,
                                 unsigned long long fac[]) {
  if (n < r) return 0;
  if (r == 0) return 1;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
void dfs(vector<vector<long long>> &v, vector<long long> &df, long long seen[],
         long long i) {
  df.push_back(i);
  for (long long j = 0; j < v[i].size(); j++) {
    if (seen[v[i][j]] == 0) {
      seen[v[i][j]] = seen[i];
      dfs(v, df, seen, v[i][j]);
    }
  }
}
bool BFS(vector<vector<long long>> &adj, long long src, long long dest,
         long long n, long long pred[], long long dist[]) {
  list<long long> queue;
  bool visited[n];
  for (long long i = 0; i < n; i++) {
    visited[i] = false;
    dist[i] = INF;
    pred[i] = -1;
  }
  visited[src] = true;
  dist[src] = 0;
  queue.push_back(src);
  while (!queue.empty()) {
    long long u = queue.front();
    queue.pop_front();
    for (long long i = 0; i < adj[u].size(); i++) {
      if (visited[adj[u][i]] == false) {
        visited[adj[u][i]] = true;
        dist[adj[u][i]] = dist[u] + 1;
        pred[adj[u][i]] = u;
        queue.push_back(adj[u][i]);
        if (adj[u][i] == dest) return true;
      }
    }
  }
  return false;
}
long long findConnComp(vector<vector<long long>> &v, long long seen[],
                       long long n) {
  long long j = 0;
  vector<long long> df;
  for (long long i = 0; i < n; i++) seen[i] = 0;
  for (long long i = 0; i < n; i++) {
    if (!seen[i]) {
      seen[i] = ++j;
      dfs(v, df, seen, i);
    }
  }
  return j;
}
vector<long long> dijkstra_set(vector<vector<pair<long long, long long>>> &adj,
                               long long src, long long V) {
  set<pair<long long, long long>> setds;
  vector<long long> dist(V, INF);
  setds.insert(make_pair(0LL, src));
  dist[src] = 0;
  vector<long long> parent(V);
  parent[src] = src;
  while (!setds.empty()) {
    pair<long long, long long> tmp = *(setds.begin());
    setds.erase(setds.begin());
    long long u = tmp.second;
    for (auto it = adj[u].begin(); it != adj[u].end(); it++) {
      long long v = (*it).first;
      long long weight = (*it).second;
      if (dist[v] > dist[u] + weight) {
        parent[v] = u;
        if (dist[v] != INF) setds.erase(setds.find(make_pair(dist[v], v)));
        dist[v] = dist[u] + weight;
        setds.insert(make_pair(dist[v], v));
      }
    }
  }
  return dist;
}
void printpath(vector<long long> &v1, long long dest) {
  if (v1[dest] == dest) {
    cout << dest << ' ';
    return;
  }
  printpath(v1, v1[dest]);
  cout << dest << ' ';
}
bool bi = true;
void dfs1(vector<vector<long long>> &v, long long seen[], long long i,
          long long colour) {
  seen[i] = colour;
  for (long long j = 0; j < v[i].size(); j++) {
    if (seen[v[i][j]] == -1) {
      dfs1(v, seen, v[i][j], 1 - colour);
    } else if (seen[i] == seen[v[i][j]]) {
      bi = false;
      break;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> v(n);
  long long seen[n];
  for (long long i = 0; i < n; i++) seen[i] = -1;
  for (long long i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    v[x - 1].push_back(y - 1);
    v[y - 1].push_back(x - 1);
  }
  for (long long i = 0; i < n; i++) {
    if (seen[i] == -1) {
      dfs1(v, seen, i, 0);
    }
  }
  if (!bi)
    cout << -1;
  else {
    vector<long long> v1, v2;
    for (long long i = 0; i < n; i++)
      if (seen[i] == 0) {
        v1.push_back(i);
      } else
        v2.push_back(i);
    cout << v1.size() << "\n";
    for (long long i = 0; i < v1.size(); i++) cout << v1[i] + 1 << " ";
    cout << "\n";
    cout << v2.size() << "\n";
    for (long long i = 0; i < v2.size(); i++) cout << v2[i] + 1 << " ";
  }
}