CSES - Aalto Competitive Programming 2024 - wk3 - Wed - Sorting coins
  • Time limit: 1.00 s
  • Memory limit: 512 MB

Maija is sorting her coin collection by size. She has nn coins numbered 1,2,,n1,2,\dots,n and a sloped surface that has mm holes in it numbered 1,2,,m1,2,\dots,m. The ii-th coin has radius aia_i and the jj-th hole has radius bjb_j. Hole number 11 is at the top of the slope and hole number mm is at the bottom. For each coin, find the number of the hole it falls to when Maija lets it slide from the top. The end of the slope is interpreted as hole m+1m+1.

Input

The first line contains two integers nn and mm. The second line contains nn integers a1,a2,,ana_1,\,a_2,\dots,\,a_n. The third line contains mm integers b1,b2,,bmb_1,\,b_2,\dots,\,b_m.

Output

Print the hole numbers on a single line as ans1,ans2,,ansnans_1,\,ans_2,\,\dots,\,ans_n.

Constraints

  • 1n,m1051 \leq n, m \leq 10^5
  • 1ai,bj1091 \leq a_i, b_j \leq 10^9

Example 1

Input:

10 11
4 4 4 6 6 3 7 9 6 4 
1 2 3 3 4 4 7 8 9 10 10 

Output:

5 5 5 7 7 3 7 9 7 5

Example 2

Input:

10 11
10 8 7 9 4 1 2 4 3 10 
3 6 4 4 4 6 6 3 7 9 6 

Output:

12 10 9 10 2 1 1 2 1 12