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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AlexFetisov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskF_CF_R solver = new TaskF_CF_R();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskF_CF_R {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            int[] b = new int[n];
            long sum1 = 0, sum2 = 0;
            for (int i = 0; i < n; ++i) {
                a[i] = in.nextInt();
                sum1 += a[i];
            }
            for (int i = 0; i < n; ++i) {
                b[i] = in.nextInt();
                sum2 += b[i];
            }

            if (sum1 < sum2) {
                solve(out, a, b, false);
            } else {
                solve(out, b, a, true);
            }
        }

        private void solve(PrintWriter out, int[] a, int[] b, boolean swapped) {
            int[] f = new int[1000001];
            int[] s = new int[1000001];
            Arrays.fill(f, -2);
            f[0] = s[0] = -1;
            long sumX = 0;
            long sumY = 0;
            int ptr = -1;
            for (int i = 0; i < a.length; ++i) {
                sumX += a[i];
                while (ptr + 1 < b.length && sumY + b[ptr + 1] <= sumX) {
                    sumY += b[ptr + 1];
                    ++ptr;
                }
                int delta = (int) (sumX - sumY);
                if (f[delta] != -2) {
                    if (swapped) {
                        print(out, s[delta], ptr);
                        print(out, f[delta], i);
                    } else {
                        print(out, f[delta], i);
                        print(out, s[delta], ptr);
                    }
                    return;
                } else {
                    f[delta] = i;
                    s[delta] = ptr;
                }

            }
        }

        private void print(PrintWriter out, int from, int to) {
            out.println(to - from);
            for (int i = from + 1; i <= to; ++i) {
                out.print((i + 1) + " ");
            }
            out.println();
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public String nextString() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

    }
}