You are given two positive integers and two sequences of positive integers and . The sequence consists of elements, each one in the interval , while the sequence consists of elements, each one in the interval .
Task
Write a program which finds a nonempty subsequence of and a nonempty subsequence of , which have equal sums of elements.
Definition: For a sequence , a subsequence of is a sequence of elements of for which .
Input
From the first line of the standard input, your program reads a positive integer - the size of sequence . From the second line, your program reads positive integers - the elements of
From the third line of the standard input, your program reads a positive integer - the size of sequence . From the fourth line, your program reads positive integers - the elements of .
Output
On the first line of the standard output, your program should print a positive integer - the size of the chosen subsequence of . On the second line, your program should print integers - the indices of the chosen elements from . On the third line of the standard output, your program should print a positive integer - the size of the chosen subsequence of . On the fourth line, your program should print integers - the indices of the chosen elements from .
Attention: Indices start from . The order in which your program prints the chosen indices doesn't matter. It is guaranteed that at least one solution exists. If more than one solution exists, print any one of them.
Constraints
Evaluation
The test cases are divided into groups, each of which consists of two tests. The points for each group are given only if your solution passes both tests from the group.
- In of the groups
- In other оf the groups
Example
stdin
5
2 3 3 2 3
3
4 5 5
stdout
3
1 2 4
2
0 1
Explanation
.
Another possible solution is: .