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;
long long power(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * power(a * a % md, b / 2, md) % md
                      : power(a * a % md, b / 2, md) % md));
}
const int xn = 1e6 + 10;
const int xm = -20 + 10;
const int sq = 320;
const int inf = 1e9 + 10;
const long long INF = 1e18 + 10;
const int mod = 998244353;
const int base = 257;
int n, c[xn], ptr;
pair<long long, long long> a[xn], part[xn], ans[2];
vector<pair<int, int> > vec[xn];
bool flag;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; ++i)
    cin >> a[i].first, part[i].first = part[i - 1].first + a[i].first;
  for (int i = 1; i <= n; ++i)
    cin >> a[i].second, part[i].second = part[i - 1].second + a[i].second;
  if (part[n].first > part[n].second) {
    for (int i = 1; i <= n; ++i) {
      swap(a[i].first, a[i].second);
      swap(part[i].first, part[i].second);
    }
    flag = true;
  }
  for (int i = 0; i <= n; ++i) {
    while (part[ptr].second < part[i].first) ++ptr;
    vec[part[ptr].second - part[i].first].push_back({i, ptr});
  }
  for (int i = 0; i < n; ++i) {
    if (int(vec[i].size()) < 2) continue;
    ans[0] = vec[i][0];
    ans[1] = vec[i][1];
    break;
  }
  if (flag) {
    swap(ans[0].first, ans[0].second);
    swap(ans[1].first, ans[1].second);
  }
  cout << ans[1].first - ans[0].first << '\n';
  for (int i = ans[0].first + 1; i <= ans[1].first; ++i) cout << i << ' ';
  cout << '\n';
  cout << ans[1].second - ans[0].second << '\n';
  for (int i = ans[0].second + 1; i <= ans[1].second; ++i) cout << i << ' ';
  cout << '\n';
  return 0;
}