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>
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
using namespace std;
const long long MOD = 1e+9 + 7;
const long long INF = LLONG_MAX;
const int INFi = INT_MAX;
const long long N = 1e+6 + 8;
vector<long long> adj[N];
long long vis[N];
long long dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};
long long test_cases = 1;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
;
long long n, a[N], b[N], pre_a[N], pre_b[N], sum_a, sum_b, val, yes = 0;
map<long long, vector<pair<long long, long long> > > diff;
long long P(long long key) { return (pre_b[key] <= val); }
long long bs(long long L, long long R) {
  while (L < R) {
    long long mid = (L + R + 1) / 2;
    if (P(mid))
      L = mid;
    else
      R = mid - 1;
  }
  return L;
}
void print_answer(long long st_a, long long en_a, long long st_b,
                  long long en_b) {
  if (yes) swap(st_a, st_b), swap(en_a, en_b);
  cout << en_a - st_a + 1;
  cout << "\n";
  for (long long i = (st_a); i <= en_a; i++) cout << i << " ";
  cout << "\n";
  cout << en_b - st_b + 1;
  cout << "\n";
  for (long long i = (st_b); i <= en_b; i++) cout << i << " ";
  cout << "\n";
}
void MAIN(long long tc) {
  cin >> n;
  for (long long i = (1); i <= n; i++) cin >> a[i];
  for (long long i = (1); i <= n; i++) cin >> b[i];
  for (long long i = (1); i <= n; i++) sum_a += a[i], sum_b += b[i];
  if (sum_a > sum_b) swap(a, b), yes = 1;
  for (long long i = (1); i <= n; i++) {
    pre_a[i] = pre_a[i - 1] + a[i];
    pre_b[i] = pre_b[i - 1] + b[i];
  }
  for (long long i = (1); i <= n; i++) {
    val = pre_a[i];
    long long ind_in_b = bs(0, n);
    if (ind_in_b == 0) continue;
    long long d = pre_b[ind_in_b] - pre_a[i];
    diff[d].push_back({i, ind_in_b});
    if (diff[d].size() == 2) {
      print_answer(diff[d][0].first + 1, diff[d][1].first,
                   diff[d][0].second + 1, diff[d][1].second);
      break;
    }
    if (d == 0) {
      print_answer(1, diff[d][0].first, 1, diff[d][0].second);
      break;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(10);
  ;
  for (long long i = (1); i <= test_cases; i++) {
    MAIN(i);
  }
}