喜欢的袜子

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

土拨鼠猴猴喜欢闻袜子

Description

土拨鼠猴猴有一排nn只袜子aia_i, 她有mm种喜欢的袜子bib_i

她想知道, 在这一排袜子中, 有哪些袜子是她喜欢闻的?

把这些袜子给出来

Format

Input

第1行两个整数n,mn, m

第2行nn个整数, 表示这一排袜子aia_i

第3行mm个整数, 表示猴猴喜欢闻的袜子bib_i.

Output

输出所有猴猴喜欢闻的袜子的序列, 给出的顺序应该和原始顺序相同

Samples

7 3
3 5 7 1 6 2 8
1 2 7
7 1 2
4 4
3 4 1 0
0 1 7 9
1 0

Limitation

1s, 1024KiB for each test case.

1<=n,m<=1061 <= n, m <= 10^6

1<=ai,bi<=1061 <= a_i, b_i <= 10^6

大明

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
38
Start at
2025-2-11 16:00
End at
2025-2-28 8:00
Duration
400 hour(s)
Host
Partic.
7