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>
inline int getch() {
  static int size = 0, pt = 0;
  static char buf[1048576];
  if (size == pt) {
    pt = buf[size = fread(buf, sizeof(char), 1048575, stdin)] = '\0';
    if (size == 0) return EOF;
  }
  return buf[pt++];
}
inline int get_int() {
  register int ch, flag = 1, x;
  for (ch = getch(); ch != EOF && (unsigned)(ch ^ '0') > 9; ch = getch())
    if (ch == '-') flag = -1;
  if (ch == EOF) return EOF;
  for (x = ch ^ '0', ch = getch(); (unsigned)(ch ^ '0') < 10; ch = getch())
    x = (x << 3) + (x << 1) + (ch ^ '0');
  return x * flag;
}
struct IN {
  const IN &operator>>(char &ch) const { return ch = getch(), *this; }
  const IN &operator>>(int &x) const { return x = get_int(), *this; }
} in;
namespace OUTBUFFER {
char buf[1048576];
int pt;
inline void putch(register char ch) { buf[pt++] = ch; }
inline void flush() {
  if (pt) fwrite(buf, sizeof(char), pt, stdout), pt = 0;
}
inline void check() {
  if (pt > 1000000) flush();
}
}  // namespace OUTBUFFER
inline void put_int(register int x) {
  using namespace OUTBUFFER;
  char temp[23];
  register int top;
  if (x == 0) return putch('0');
  if (x < 0) putch('-'), x = -x;
  for (top = 0; x; temp[++top] = x % 10, x /= 10)
    ;
  do putch(temp[top] ^ '0');
  while (--top);
}
struct OUT {
  OUT() { OUTBUFFER::pt = 0; }
  ~OUT() { OUTBUFFER::flush(); }
  const OUT &operator<<(register char ch) const {
    OUTBUFFER::putch(ch);
    return *this;
  }
  const OUT &operator<<(const char *str) const {
    while (*str) OUTBUFFER::putch(*str++);
    OUTBUFFER::check();
    return *this;
  }
  const OUT &operator<<(register int x) const {
    put_int(x), OUTBUFFER::check();
    return *this;
  }
} out;
int N;
long long SumA[1000005], SumB[1000005];
struct Data {
  int i, j;
} data[1000005];
inline void init() {
  in >> N;
  SumA[0] = 0;
  for (register int i = 1; i <= N; ++i) SumA[i] = SumA[i - 1] + get_int();
  SumB[0] = 0;
  for (register int i = 1; i <= N; ++i) SumB[i] = SumB[i - 1] + get_int();
  data[0].i = data[0].j = 0;
}
inline void solve() {
  bool b = false;
  long long *A, *B;
  int l1, r1, l2, r2, pt = 0;
  if (SumA[N] >= SumB[N])
    A = SumB, B = SumA, b = true;
  else
    A = SumA, B = SumB;
  for (register int i = 1; i <= N; ++i) {
    while (B[pt] < A[i]) ++pt;
    pt -= (B[pt] > A[i]);
    register int delta = A[i] - B[pt];
    if (delta == 0) {
      l1 = l2 = 0;
      r1 = i, r2 = pt;
      break;
    } else if (data[delta].i) {
      l1 = data[delta].i, l2 = data[delta].j;
      r1 = i, r2 = pt;
      break;
    } else {
      data[delta].i = i, data[delta].j = pt;
    }
  }
  if (b) {
    out << (r2 - l2) << '\n';
    for (register int i = l2 + 1; i <= r2; ++i) out << i << " \n"[i == r2];
    out << (r1 - l1) << '\n';
    for (register int i = l1 + 1; i <= r1; ++i) out << i << " \n"[i == r1];
  } else {
    out << (r1 - l1) << '\n';
    for (register int i = l1 + 1; i <= r1; ++i) out << i << " \n"[i == r1];
    out << (r2 - l2) << '\n';
    for (register int i = l2 + 1; i <= r2; ++i) out << i << " \n"[i == r2];
  }
}
int main() {
  init();
  solve();
  return 0;
}