Elimination round completed
Tasks
Show one task per page / all tasks on one page
Time limit  4 seconds 

Memory limit  256 megabytes 
Consider two arrays of integers A = [a_{1}, a_{2}, ..., a_{n}] and B = [b_{1}, b_{2}, ..., b_{m}]. Let us introduce their kjoin as a lexicographically smallest array R of length k, that can be divided to two nonempty subsequences, first of which is a subsequence of A, and the second one is a subsequence of B.
Formally speaking, you need to find such array R = [r_{1}, r_{2}, ..., r_{k}], that there are two nonempty sequences of indices 1 ≤ i_{1, 1} < i_{1, 2} < ... < i_{1, t} ≤ n and 1 < j_{1, 1} < j_{1, 2} < ... < j_{1, k  t} ≤ m in the original arrays, and two sequences of indices 1 ≤ i_{2, 1} < i_{2, 2} < ... < i_{2, t} ≤ k and 1 ≤ j_{2, 1} < j_{2, 1} < ... < j_{2, k  t} ≤ k, such that:
 For each 1 ≤ p ≤ t, 1 ≤ q ≤ k  t we have i_{2, p} ≠ j_{2, q};
 For each 1 ≤ p ≤ t we have a_{i1, p} = r_{i1, p};
 For each 1 ≤ p ≤ k  t we have b_{j1, p} = r_{j1, p}.
For example if A = [1, 2, 1, 3, 1, 2, 1], B = [1, 2, 3, 1], and k = 9, their kjoin is the array R = [1, 1, 1, 1, 2, 1, 2, 3, 1] (subsequence from the first array — [1, 1, 1, 2, 1], subsequence from the second array — [1, 2, 3, 1]).
For two given arrays A and B, and an integer k find their kjoin R.
Input format 
The first line of input contains n — length of array A (1 ≤ n ≤ 3000). The second line contains n integers a_{i} — array A (1 ≤ a_{i} ≤ 3000). The third line contains m — length of array B (1 ≤ m ≤ 3000). The fourth line contains m integers b_{i} — array B (1 ≤ b_{i} ≤ 3000). The last line contains integer k (2 ≤ k ≤ n + m). 

Output format 
Output kjoin of the given arrays. 
Examples 
Input data
7 1 2 1 3 1 2 1 4 1 2 3 1 9
Output data
1 1 1 1 2 1 2 3 1 
