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.math.*;
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int A[] = new int[n];
        int B[] = new int[n];
        for (int i = 0; i < n; ++ i) {
            A[i] = in.nextInt();
        }
        for (int i = 0; i < n; ++ i) {
            B[i] = in.nextInt();
        }
        int answer[][];
        if (sum(A) > sum(B)) {
            answer = solve(B,A);
            int[] tmp = answer[1];
            answer[1] = answer[0];
            answer[0] = tmp;
        } else {
            answer = solve(A,B);
        }
        for (int t = 0; t < 2; ++ t) {
            out.println(answer[t].length);
            for (int i = 0; i < answer[t].length; ++ i) {
                if (i > 0) out.print(' ');
                out.print(answer[t][i]);
            }
            out.println();
        }

        out.close();
    }

    long sum(int[] A) {
        long ret = 0;
        for (int x : A)
            ret += x;
        return ret;
    }

    int[][] solve(int[] A,int[] B) {
        int n = A.length;
        int prev[] = new int[n];
        Arrays.fill(prev,-1);
        prev[0] = 0;
        int ptr[] = new int[n + 1];
        long a = 0,b = 0;
        for (int i = 0,j = 0; i < n; ++ i) {
            a += A[i];
            while (j < n && a >= b + B[j]) {
                b += B[j++];
            }
            ptr[i + 1] = j;
            if (prev[(int)(a - b)] != -1) {
                int t = prev[(int)(a - b)];
                int[][] ret = new int[2][];
                ret[0] = new int[i - t + 1];
                for (int x = t; x <= i; ++ x) {
                    ret[0][x - t] = x + 1;
                }
                ret[1] = new int[ptr[i + 1] - ptr[t]];
                for (int x = ptr[t]; x < ptr[i + 1]; ++ x) {
                    ret[1][x - ptr[t]] = x + 1;
                }
                return ret;
            }
            prev[(int)(a - b)] = i + 1;
        }

        return new int[2][2];
    }

    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());
        }
    }
}