Problem: You are given two multisets A and B. Each multiset has exactly n integers each between 1 and n inclusive. Multisets may contain multiple copies of the same number.

You would like to find a nonempty subset of A and a nonempty subset of B such that the sum of elements in these subsets are equal. Subsets are also multisets, i.e. they can contain elements with equal values.

If no solution exists, print  - 1. Otherwise, print the indices of elements in any such subsets of A and B that have the same sum.

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 1 000 000) — the size of both multisets.

The second line contains n integers, denoting the elements of A. Each element will be between 1 and n inclusive.

The third line contains n integers, denoting the elements of B. Each element will be between 1 and n inclusive.

Output

If there is no solution, print a single integer  - 1. Otherwise, your solution should be printed on four lines.

The first line should contain a single integer ka, the size of the corresponding subset of A. The second line should contain ka distinct integers, the indices of the subset of A.

The third line should contain a single integer kb, the size of the corresponding subset of B. The fourth line should contain kb distinct integers, the indices of the subset of B.

Elements in both sets are numbered from 1 to n. If there are multiple possible solutions, print any of them.

Examples

Input

10
10 10 10 10 10 10 10 10 10 10
10 9 8 7 6 5 4 3 2 1


Output

1
2
3
5 8 10


Input

5
4 4 3 3 3
2 2 2 2 5


Output

2
2 3
2
3 5

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<ll, ll>;
using vi = vector<ll>;
using ld = long double;
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (ll i = ll(0); i < ll((ll)v.size()); i++) {
    if (i) os << ",";
    os << v[i];
  }
  os << "]";
  return os;
}
ll read() {
  ll i;
  scanf("%lld", &i);
  return i;
}
void printSpace() { printf(" "); }
void printEoln() { printf("\n"); }
void print(ll x, ll suc = 1) {
  printf("%lld", x);
  if (suc == 1) printEoln();
  if (suc == 2) printSpace();
}
string readString() {
  static char buf[3341919];
  scanf("%s", buf);
  return string(buf);
}
char* readCharArray() {
  static char buf[3341919];
  static ll bufUsed = 0;
  char* ret = buf + bufUsed;
  scanf("%s", ret);
  bufUsed += strlen(ret) + 1;
  return ret;
}
template <class T, class U>
void chmax(T& a, U b) {
  if (a < b) a = b;
}
template <class T, class U>
void chmin(T& a, U b) {
  if (a > b) a = b;
}
template <class T>
T Sq(const T& t) {
  return t * t;
}
signed main() {
  ll n = read();
  vi a, b;
  vector<pi> memo(2 * n, pi(-1, -1));
  memo[n] = pi(0, 0);
  for (ll i = ll(0); i < ll(n); i++) a.push_back(read());
  for (ll i = ll(0); i < ll(n); i++) b.push_back(read());
  ll x = 1, y = 1, dif = a[0] - b[0];
  while (memo[dif + n] == pi(-1, -1)) {
    memo[dif + n] = pi(x, y);
    if (dif < 0) {
      assert(x < n);
      dif += a[x++];
    } else {
      assert(y < n);
      dif -= b[y++];
    }
  }
  print(x - memo[dif + n].first);
  for (ll i = ll(memo[dif + n].first); i < ll(x); i++)
    print(i + 1, i == x - 1 ? 1 : 2);
  print(y - memo[dif + n].second);
  for (ll i = ll(memo[dif + n].second); i < ll(y); i++)
    print(i + 1, i == y - 1 ? 1 : 2);
}