Skip to content
C

Common Elements in Three Arrays

Easyjavapythonccppjavascript

Given three sorted arrays, find the values that occur in all three.

Input Format

The input contains three arrays, each given as its length on one line followed by that many space-separated integers on the next line: N, array A, M, array B, P, array C. Each array is sorted in non-decreasing order.

Output Format

Print the distinct common values in increasing order, separated by single spaces. If there are none, print an empty line.

Input (stdin)

Output

Run your code to see output here...