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;
const int inf = 2e9;
const double eps = 1e-6;
const int maxn = 1e6 + 10, base = 1e9 + 7;
const int sigm = 26;
const long long llinf = 1e18;
void bad(string mes = "Impossible") {
  cout << mes;
  exit(0);
}
template <typename T>
string bin(T x) {
  string ans = "";
  while (x > 0) {
    ans += char('0' + x % 2);
    x /= 2;
  }
  reverse(ans.begin(), ans.end());
  return ans.empty() ? "0" : ans;
}
template <typename T>
T dcm(string& second) {
  T x = 0;
  for (int i = 0; i < second.size(); i++) {
    x = (x * 2) + (second[i] == '1');
  }
  return x;
}
template <typename T>
T input() {
  T ans = 0, m = 1;
  char c = ' ';
  while (c == ' ' || c == '\n') c = getchar();
  if (c == '-') m = -1, c = getchar();
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + int(c - '0'), c = getchar();
  }
  return ans * m;
}
template <typename T>
T binpow(T n, T second) {
  if (second == 0) return 1LL;
  if (second % 2 == 0) {
    T b = binpow(n, second / 2) % base;
    return (1LL * b * b) % base;
  } else {
    return (1LL * binpow(n, second - 1) * n) % base;
  }
}
long long pref1[maxn], pref2[maxn], a[maxn], b[maxn];
int paired[maxn], used[maxn];
int main() {
  int n = input<int>();
  for (int i = 1; i <= n; i++) {
    a[i] = input<long long>();
    pref1[i] = pref1[i - 1] + a[i];
  }
  for (int i = 1; i <= n; i++) {
    b[i] = input<long long>();
    pref2[i] = pref2[i - 1] + b[i];
  }
  memset(used, -1, sizeof(used));
  int l2 = 0;
  for (int l1 = 0; l1 <= n; l1++) {
    while (l2 <= n && pref2[l2] < pref1[l1]) ++l2;
    long long sum1 = pref1[l1], sum2 = pref2[l2];
    if (used[sum2 - sum1] != -1) {
      int pairedl1 = used[sum2 - sum1];
      int pairedl2 = paired[pairedl1];
      cout << l1 - pairedl1 << '\n';
      for (int i = pairedl1 + 1; i <= l1; i++) cout << i << ' ';
      puts("");
      cout << l2 - pairedl2 << '\n';
      for (int i = pairedl2 + 1; i <= l2; i++) cout << i << ' ';
      bad("");
    } else {
      paired[l1] = l2;
      used[sum2 - sum1] = l1;
    }
  }
  return 0;
}