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 max(long long a, long long b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
long long min(long long a, long long b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << ", ";
  err(++it, args...);
}
template <typename T>
struct number_iterator : std::iterator<random_access_iterator_tag, T> {
  T v;
  number_iterator(T _v) : v(_v) {}
  operator T&() { return v; }
  T operator*() const { return v; }
};
template <typename T>
struct number_range {
  T b, e;
  number_range(T b, T e) : b(b), e(e) {}
  number_iterator<T> begin() { return b; }
  number_iterator<T> end() { return e; }
};
template <typename T>
number_range<T> range(T e) {
  return number_range<T>(1, e + 1);
}
template <typename T>
number_range<T> range(T b, T e) {
  return number_range<T>(b, e + 1);
}
int n;
int a[2000001], b[2000001];
long long c1[2000001];
long long t1, t2;
long long ap[6000001], ax[6000001];
pair<long long, int> T[600001];
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); i++) {
    scanf("%d", &a[i]);
    t1 += a[i];
  }
  for (int i = (1); i <= (n); i++) {
    scanf("%d", &b[i]);
    t2 += b[i];
  }
  int sw = 0;
  if (t1 <= t2) {
    swap(a, b);
    sw = 1;
  }
  c1[0] = 0;
  for (int i = (1); i <= (n); i++) c1[i] = c1[i - 1] + a[i];
  long long tot = 0;
  for (int i = (1); i <= (n); i++) {
    tot += b[i];
    int low = 1, high = n, res = n;
    while (low <= high) {
      int mid = (low + high) >> 1;
      if (c1[mid] >= tot) {
        res = mid;
        high = mid - 1;
      } else
        low = mid + 1;
    }
    T[i] = make_pair(c1[res] - tot, res);
  }
  for (int i = (0); i <= (6000000); i++) ap[i] = -1;
  ap[1000001] = ax[1000001] = 0;
  for (int i = (1); i <= (n); i++) {
    long long p = T[i].first;
    if (ap[p + 1000001] != -1) {
      if (sw) {
        printf("%d\n", (int)(i - ax[p + 1000001]));
        for (int j = (ax[p + 1000001] + 1); j <= (i); j++) printf("%d ", j);
        printf("\n%d\n", (int)(T[i].second - ap[p + 1000001]));
        for (int j = (ap[p + 1000001] + 1); j <= (T[i].second); j++)
          printf("%d ", j);
        puts("");
        return 0;
      } else {
        printf("%d\n", (int)(T[i].second - ap[p + 1000001]));
        for (int j = (ap[p + 1000001] + 1); j <= (T[i].second); j++)
          printf("%d ", j);
        printf("\n%d\n", (int)(i - ax[p + 1000001]));
        for (int j = (ax[p + 1000001] + 1); j <= (i); j++) printf("%d ", j);
        puts("");
        return 0;
      }
    } else {
      ax[p + 1000001] = i;
      ap[p + 1000001] = T[i].second;
    }
  }
  puts("-1");
  return 0;
}