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 n coins numbered 1,2,\dots,n and a sloped surface that has m holes in it numbered 1,2,\dots,m. The i-th coin has radius a_i and the j-th hole has radius b_j. Hole number 1 is at the top of the slope and hole number m 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+1.

Input

The first line contains two integers n and m. The second line contains n integers a_1,\,a_2,\dots,\,a_n. The third line contains m integers b_1,\,b_2,\dots,\,b_m.

Output

Print the hole numbers on a single line as ans_1,\,ans_2,\,\dots,\,ans_n.

Constraints

  • 1 \leq n, m \leq 10^5
  • 1 \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