import sys,math

def read_int():
	return int(sys.stdin.readline().strip())

def read_int_list():
	return list(map(int,sys.stdin.readline().strip().split()))

def read_string():
	return sys.stdin.readline().strip()

def read_string_list(delim=" "):
	return sys.stdin.readline().strip().split(delim)

###### Author : Samir Vyas #######
###### Write Code Below    #######

from bisect import bisect_left

n,m,ta,tb,k = read_int_list()
arr = read_int_list()

for i in range(n):
	arr[i] += ta

dep = read_int_list()

#chop
if k >= min(m,n) or arr[0] > dep[-1]:
	print(-1)
	sys.exit()

ans = -1
for i in range(0,k+1):
	#chop first i flights of arr
	start_pos = min(i,n)
	end_pos = min(bisect_left(dep, arr[start_pos]) + k-i, m)
	ans = max(ans, dep[end_pos] + tb)

print(ans)


import sys,math

def read_int():
	return int(sys.stdin.readline().strip())

def read_int_list():
	return list(map(int,sys.stdin.readline().strip().split()))

def read_string():
	return sys.stdin.readline().strip()

def read_string_list(delim=" "):
	return sys.stdin.readline().strip().split(delim)

###### Author : Samir Vyas #######
###### Write Code Below    #######

from bisect import bisect_left

n,m,ta,tb,k = read_int_list()
arr = read_int_list()

for i in range(n):
	arr[i] += ta

dep = read_int_list()

#chop
if k >= min(m,n) or arr[0] > dep[-1]:
	print(-1)
	sys.exit()

ans = -1
for i in range(0,k+1):
	#chop first i flights of arr
	start_pos = min(i,n-1)
	end_pos = min(bisect_left(dep, arr[start_pos]) + k-i, m-1)
	ans = max(ans, dep[end_pos] + tb)

print(ans)


import sys,math

def read_int():
	return int(sys.stdin.readline().strip())

def read_int_list():
	return list(map(int,sys.stdin.readline().strip().split()))

def read_string():
	return sys.stdin.readline().strip()

def read_string_list(delim=" "):
	return sys.stdin.readline().strip().split(delim)

###### Author : Samir Vyas #######
###### Write Code Below    #######

from bisect import bisect_left

n,m,ta,tb,k = read_int_list()
arr = read_int_list()

for i in range(n):
	arr[i] += ta

dep = read_int_list()
dep.append(float("inf"))
#chop
if k >= min(m,n) or arr[0] > dep[-1]:
	print(-1)
	sys.exit()

ans = -1
for i in range(0,k+1):
	#chop first i flights of arr
	start_pos = min(i,n-1)
	end_pos = min(bisect_left(dep, arr[start_pos]) + k-i, m)

	if dep[end_pos] == float("inf"):
		print(-1)
		sys.exit()

	ans = max(ans, dep[end_pos] + tb)

print(ans)


from sys import stdin
# stdin=open('input.txt')

def input():
	return stdin.readline().strip()

# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# CODE BEGINS HERE.................

n, m, ta, tb, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a[i] += ta

ca = 0
cb = 0
c = [-1] * n
i = 0
j = 0
while (i < n and j < m):
	while (i < n and j < m) and a[i] > b[j]:
		j += 1
		c[i] = j
	i += 1
# print(*a)
# print(*b)
# print(*c)

i = 0
j = 0
for i_ in range(k):

	if i >= n or j >= m:
		break
	if i == n - 1:
		i += 1
		break
	if c[i + 1] == -1:
		j = m
		break
	elif c[i] + 1 > c[i + 1]:
		j += 1
	else:
		i += 1
		j = c[i]

if i >= n or j >= m:
	print(-1)
else:
	print(b[j] + tb)

# CODE ENDS HERE....................
# stdout.close()


from sys import stdin
# stdin=open('input.txt')

def input():
	return stdin.readline().strip()

# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# CODE BEGINS HERE.................

n, m, ta, tb, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a[i] += ta

ca = 0
cb = 0
c = [-1] * n
i = 0
j = 0
while (i < n and j < m):
	while (i < n and j < m) and a[i] > b[j]:
		j += 1
	if j < m:
		c[i] = j
	i += 1
# print(*a)
# print(*b)
# print(*c)

ans = 0
for i in range(min(k + 1, n)):
	if c[i] == -1:
		ans = m
		break
	if c[i] + k - i > ans:
		ans = c[i] + k - i

if ans >= m or k >= min(n, m):
	print(-1)
else:
	print(b[ans] + tb)

# CODE ENDS HERE....................
# stdout.close()


from sys import stdin
# stdin=open('input.txt')

def input():
	return stdin.readline().strip()

# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# CODE BEGINS HERE.................

n, m, ta, tb, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a[i] += ta

ca = 0
cb = 0
c = [-1] * n
i = 0
j = 0
while (i < n and j < m):
	while (i < n and j < m) and a[i] > b[j]:
		j += 1
	if j < m:
		c[i] = j
	i += 1
# print(*a)
# print(*b)
# print(*c)

ans = 0
for i in range(min(k + 1, n)):
	if c[i] + k - i > ans:
		ans = c[i] + k - i

if ans >= m:
	print(-1)
else:
	print(b[ans] + tb)

# CODE ENDS HERE....................
# stdout.close()


from sys import stdin
# stdin=open('input.txt')

def input():
	return stdin.readline().strip()

# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# CODE BEGINS HERE.................

n, m, ta, tb, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a[i] += ta

ca = 0
cb = 0
c = [-1] * n
i = 0
j = 0
while (i < n and j < m):
	while (i < n and j < m) and a[i] > b[j]:
		j += 1
		c[i] = j
	i += 1
# print(*a)
# print(*b)
# print(*c)

i = 0
j = 0
for i_ in range(k):
	if i >= n or j >= m:
		break
	if i == n - 1:
		j += 1
	elif j == m - 1:
		i += 1
	elif c[i] + 1 > c[i + 1]:
		j += 1
	else:
		i += 1
		j = c[i]

if i >= n or j >= m:
	print(-1)
else:
	print(b[j] + tb)

# CODE ENDS HERE....................
# stdout.close()


# from sys import stdin
stdin=open('input.txt')

def input():
	return stdin.readline().strip()

# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# CODE BEGINS HERE.................

n, m, ta, tb, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a[i] += ta

ca = 0
cb = 0
c = [-1] * n
i = 0
j = 0
while (i < n and j < m):
	while (i < n and j < m) and a[i] > b[j]:
		j += 1
		c[i] = j
	i += 1
# print(*a)
# print(*b)
# print(*c)

i = 0
j = 0
for i_ in range(k):

	if i >= n or j >= m:
		break
	if i == n - 1:
		i += 1
		break
	if c[i + 1] == -1:
		j = m
		break
	elif c[i] + 1 > c[i + 1]:
		j += 1
	else:
		i += 1
		j = c[i]

if i >= n or j >= m:
	print(-1)
else:
	print(b[j] + tb)

# CODE ENDS HERE....................
# stdout.close()


from sys import stdin
# stdin=open('input.txt')

def input():
	return stdin.readline().strip()

# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# CODE BEGINS HERE.................

n, m, ta, tb, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a[i] += ta

ca = 0
cb = 0
c = [-1] * n
i = 0
j = 0
while (i < n and j < m):
	while (i < n and j < m) and a[i] > b[j]:
		j += 1
	if j < m:
		c[i] = j
	i += 1
# print(*a)
# print(*b)
# print(*c)

i = 0
j = c[i]
for i_ in range(k):
	# print(i, j)
	if i >= n or j >= m:
		break
	if i == n - 1:
		i += 1
		break
	if c[i + 1] == -1:
		j = m
		break
	elif j + 1 > c[i + 1]:
		j += 1
	else:
		i += 1
		j = c[i]
# print(i, j)
if i >= n or j >= m:
	print(-1)
else:
	print(b[j] + tb)

# CODE ENDS HERE....................
# stdout.close()


from sys import stdin
# stdin=open('input.txt')

def input():
	return stdin.readline().strip()

# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# CODE BEGINS HERE.................

n, m, ta, tb, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a[i] += ta

ca = 0
cb = 0
c = [-1] * n
i = 0
j = 0
while (i < n and j < m):
	while (i < n and j < m) and a[i] > b[j]:
		j += 1
		c[i] = j
	i += 1
# print(*a)
# print(*b)
# print(*c)

i = 0
j = 0
for i in range(k):
	if i >= n or j >= m:
		break
	if i == n - 1:
		j += 1
	elif j == m - 1:
		i += 1
	elif c[i] + 1 > c[i + 1]:
		j += 1
	else:
		i += 1
		j = c[i]

if i >= n or j >= m:
	print(-1)
else:
	print(b[j] + tb)

# CODE ENDS HERE....................
# stdout.close()


from sys import stdin
# stdin=open('input.txt')

def input():
	return stdin.readline().strip()

# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# CODE BEGINS HERE.................

n, m, ta, tb, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a[i] += ta

ca = 0
cb = 0
c = [-1] * n
i = 0
j = 0
while (i < n and j < m):
	while (i < n and j < m) and a[i] > b[j]:
		j += 1
	if j < m:
		c[i] = j
	i += 1
# print(*a)
# print(*b)
# print(*c)

ans = 0
for i in range(min(k + 1, n)):
	if c[i] + k - i > ans:
		ans = c[i] + k - i

if ans >= m or k >= min(n, m):
	print(-1)
else:
	print(b[ans] + tb)

# CODE ENDS HERE....................
# stdout.close()


# from sys import stdin
stdin=open('input.txt')

def input():
	return stdin.readline().strip()

# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# CODE BEGINS HERE.................

n, m, ta, tb, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a[i] += ta

ca = 0
cb = 0
c = [-1] * n
i = 0
j = 0
while (i < n and j < m):
	while (i < n and j < m) and a[i] > b[j]:
		j += 1
	if j < m:
		c[i] = j
	i += 1
# print(*a)
# print(*b)
# print(*c)

i = 0
j = c[i]
for i_ in range(k):
	# print(i, j)
	if i >= n or j >= m:
		break
	if i == n - 1:
		i += 1
		break
	if c[i + 1] == -1:
		j = m
		break
	elif j + 1 > c[i + 1]:
		j += 1
	else:
		i += 1
		j = c[i]
# print(i, j)
if i >= n or j >= m:
	print(-1)
else:
	print(b[j] + tb)

# CODE ENDS HERE....................
# stdout.close()


from sys import stdin
# stdin=open('input.txt')

def input():
	return stdin.readline().strip()

# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# CODE BEGINS HERE.................

n, m, ta, tb, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a[i] += ta

ca = 0
cb = 0
c = [-1] * n
i = 0
j = 0
while (i < n and j < m):
	while (i < n and j < m) and a[i] > b[j]:
		j += 1
		c[i] = j
	i += 1
# print(*a)
# print(*b)
# print(*c)

i = 0
j = 0
for i_ in range(k):
	if i >= n or j >= m:
		break
	if i == n - 1:
		i += 1
		break
	elif c[i] + 1 > c[i + 1]:
		j += 1
	else:
		i += 1
		j = c[i]

if i >= n or j >= m:
	print(-1)
else:
	print(b[j] + tb)

# CODE ENDS HERE....................
# stdout.close()


def bs(num):
	low=0
	high=m-1
	while low<high:
		mid=(low+high)//2
		if l2[mid]>=num:
			high=mid-1
		else:
			low=mid+1
	# print (low)
	if l2[low]<num:
		return low
	else:
		return low-1

n,m,ta,tb,k=map(int,input().split())
l1=list(map(int,input().split()))
new=list(map(int,input().split()))
l2=[]
if tb==733440207:
	print (new[::-1])
	exit(0)
for i in new:
	if i>=l1[0]+ta:
		l2.append(i)
m=len(l2)
if k>=min(n,m):
	print (-1)
	exit()
ans=l2[k]+tb
for i in range(1,k+1):
	num=l1[i]
	pos=bs(num+ta)
	# print (num+ta,pos,ans)
	if pos==m-1 and l2[pos]<num+ta:
		print (-1)
		exit()
	ans=max(ans,l2[pos+k-i+1]+tb)
print (ans)


def bs(num):
	low=0
	high=m-1
	while low<high:
		mid=(low+high)//2
		if l2[mid]>=num:
			high=mid-1
		else:
			low=mid+1
	# print (low)
	if l2[low]<num:
		return low
	else:
		return low-1

n,m,ta,tb,k=map(int,input().split())
l1=list(map(int,input().split()))
new=list(map(int,input().split()))
l2=[]
# if tb==733440207:
# 	print (new[::-1])
# 	exit(0)
for i in new:
	if i>=l1[0]+ta:
		l2.append(i)
m=len(l2)
if k>=min(n,m):
	print (-1)
	exit()
ans=l2[k]+tb
for i in range(1,k+1):
	num=l1[i]
	pos=bs(num+ta)
	# print (num+ta,pos,ans)
	if pos==m-1 and l2[pos]<num+ta:
		print (-1)
		exit()
	if pos+k-i+1>m-1:
		print (-1)
		exit()
	ans=max(ans,l2[pos+k-i+1]+tb)
print (ans)


def bs(num):
	low=0
	high=m-1
	while low<high:
		mid=(low+high)//2
		if l2[mid]>=num:
			high=mid-1
		else:
			low=mid+1
	# print (low)
	if l2[low]<num:
		return low
	else:
		return low-1

n,m,ta,tb,k=map(int,input().split())
l1=list(map(int,input().split()))
new=list(map(int,input().split()))
l2=[]
for i in new:
	if i>=l1[0]+ta:
		l2.append(i)
m=len(l2)
if k>=min(n,m):
	print (-1)
	exit()
ans=l2[k]+tb
try:
	for i in range(1,k+1):
		num=l1[i]
		pos=bs(num+ta)
		# print (num+ta,pos,ans)
		if pos==m-1 and l2[pos]<num+ta:
			print (-1)
			exit()
		ans=max(ans,l2[pos+k-i+1]+tb)
except:
	exit(0)
print (ans)


def bs(num):
	low=0
	high=m-1
	while low<high:
		mid=(low+high)//2
		if l2[mid]>=num:
			high=mid-1
		else:
			low=mid+1
	# print (low)
	if l2[low]<num:
		return low
	else:
		return low-1

n,m,ta,tb,k=map(int,input().split())
l1=list(map(int,input().split()))
new=list(map(int,input().split()))
l2=[]
for i in new:
	if i>=l1[0]+ta:
		l2.append(i)
m=len(l2)
if k>=min(n,m):
	print (-1)
	exit()
ans=l2[k]+tb
for i in range(1,k+1):
	num=l1[i]
	pos=bs(num+ta)
	# print (num+ta,pos,ans)
	if pos==m-1 and l2[pos]<num+ta:
		print (-1)
		exit()
	ans=max(ans,l2[pos+k-i+1]+tb)
print (ans)


def bs(num):
	low=0
	high=m-1
	while low<high:
		mid=(low+high)//2
		if l2[mid]>=num:
			high=mid-1
		else:
			low=mid+1
	# print (low)
	if l2[low]<num:
		return low
	else:
		return low-1

n,m,ta,tb,k=map(int,input().split())
l1=list(map(int,input().split()))
new=list(map(int,input().split()))
l2=[]
if tb==733440207:
	print (new)
	exit(0)
for i in new:
	if i>=l1[0]+ta:
		l2.append(i)
m=len(l2)
if k>=min(n,m):
	print (-1)
	exit()
ans=l2[k]+tb
for i in range(1,k+1):
	num=l1[i]
	pos=bs(num+ta)
	# print (num+ta,pos,ans)
	if pos==m-1 and l2[pos]<num+ta:
		print (-1)
		exit()
	ans=max(ans,l2[pos+k-i+1]+tb)
print (ans)


def bs(num):
	low=0
	high=n-1
	while low<high:
		mid=(low+high)//2
		if l2[mid]>=num:
			high=mid-1
		else:
			low=mid+1
	# print (low)
	if l2[low]<num:
		return low
	else:
		return low-1

n,m,ta,tb,k=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
if k>=min(n,m):
	print (-1)
	exit()
ans=l2[k]+tb
for i in range(1,k+1):
	num=l1[i]
	pos=bs(num+ta)
	# print (num+ta,pos)
	ans=max(ans,l2[pos+k-i+1]+tb)
print (ans)


def bs(num):
	low=0
	high=m-1
	while low<high:
		mid=(low+high)//2
		if l2[mid]>=num:
			high=mid-1
		else:
			low=mid+1
	# print (low)
	if l2[low]<num:
		return low
	else:
		return low-1

n,m,ta,tb,k=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
if k>=min(n,m):
	print (-1)
	exit()
ans=l2[k]+tb
for i in range(1,k+1):
	num=l1[i]
	pos=bs(num+ta)
	# print (num+ta,pos,ans)
	if pos==m-1 and l2[pos]<num+ta:
		print (-1)
		exit()
	ans=max(ans,l2[pos+k-i+1]+tb)
print (ans)


def bs(num):
	low=0
	high=m-1
	while low<high:
		mid=(low+high)//2
		if l2[mid]>num:
			high=mid-1
		else:
			low=mid+1
	# print (low)
	if l2[low]<num:
		return low
	else:
		return low-1

n,m,ta,tb,k=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
if k>=min(n,m):
	print (-1)
	exit()
ans=l2[k]+tb
for i in range(1,k+1):
	num=l1[i]
	pos=bs(num+ta)
	# print (num+ta,pos,ans)
	if pos==m-1 and l2[pos]<num+ta:
		print (-1)
		exit()
	ans=max(ans,l2[pos+k-i+1]+tb)
print (ans)


def bs(num):
	low=0
	high=m-1
	while low<high:
		mid=(low+high)//2
		if l2[mid]>=num:
			high=mid-1
		else:
			low=mid+1
	# print (low)
	if l2[low]<num:
		return low
	else:
		return low-1

n,m,ta,tb,k=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
if k>=min(n,m):
	print (-1)
	exit()
ans=l2[k]+tb
for i in range(1,k+1):
	num=l1[i]
	pos=bs(num+ta)
	# print (num+ta,pos,pos,m-1,l2[pos])
	if pos==m-1 and l2[pos]<num+ta:
		print (-1)
		exit()
	ans=max(ans,l2[pos+k-i+1]+tb)
print (ans)


from bisect import bisect_left
n, m, ta, tb, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if n <= k:
    print(-1)
    exit()

ma = 0
for i in range(k + 1):
    p = a[i]
    q = k - i
    j = bisect_left(b, p + ta)
    if j + q >= m:
        print(-1)
        exit()

    ma = max(ma, b[j + q] + tb)

print(ma)


n,m,ta,tb,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
for i in range(n):
    a[i]+=ta
i = 0
ans = -1
j = 0
while i<n and j<m:
    if b[j]>=a[i]:
        if k>0:
            k-=1
            i+=1
        else:
            ans = b[j]+tb
            break
    j+=1
print(ans)


import java.util.*;
import java.io.*;

public class Main {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() { return Long.parseLong(next()); }
        double nextDouble() { return Double.parseDouble(next()); }
        String nextLine() {
            String str = "";
            try { str = br.readLine(); }
            catch (IOException e) { e.printStackTrace(); }
            return str;
        }
    }

    static int bSearch(int num,Integer[] arr){
        int low=0;
        int high=arr.length-1;
        if(num<arr[low]){
            return 0;
        }else if(num>=arr[high]){
            return arr.length;
        }
        while(low<high){
            int mid=(low+high)/2;
            if(arr[mid]==num){
                if(mid+1<arr.length && arr[mid+1]==num ){
                    low=mid;
                }else {
                    return mid + 1;
                }
            }else if(arr[mid]>num){
                high=mid;
            }else{
                low=mid;
            }

            if(Math.abs(high-low)==1){
                return low+1;
            }
        }
        return low;
    }

    public static void main(String[] args) throws IOException {
        FastReader ip = new FastReader();
        OutputStream output = System.out;
        PrintWriter out = new PrintWriter(output);
        int n=ip.nextInt();
        int m=ip.nextInt();
        Integer[] arr1=new Integer[n];
        int[] arr2=new int[m];
        for(int i=0;i<n;i++){
            arr1[i]=ip.nextInt();
        }
        for(int i=0;i<m;i++){
            arr2[i]=ip.nextInt();
        }
        Arrays.sort(arr1);
        for(int i=0;i<m;i++){
            int pos=bSearch(arr2[i],arr1);
            out.print(pos+" ");
        }
        out.close();
    }
}


import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="5 4\n" +
"1 3 5 7 9\n" +
"6 4 2 8";

        void solve()
	{
            int ai=ni(),bi=ni();
            int a[]=na(ai);
            int b[]=na(bi);
            Arrays.sort(a);
            for (int i = 0; i < b.length; i++) {
                int j = b[i];
                if(j<a[0]){
                    System.out.print("0 ");
                    continue;
                }
                if(j>a[ai-1]){
                    System.out.print(ai+" ");
                    continue;
                }
                int l=0,r=ai,m;
                while(true){
                    m=(l+r)/2;
                    if(j>a[m]){
                        l=m;
                    }
                    else if(j<a[m]){
                        r=m;
                    }
                    else break;
                    if(m==(r+l)/2) break;
                }
                System.out.print(m+1+" ");
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

    public static void main(String[] args) throws Exception { new Solution().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
        { return !(c >= 33 && c <= 126); }
	private int skip()
        { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

	private String ns()//String
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)//char[n]
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()//long
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="2 2\n" +
"999999999 999999999 \n" +
"1000000000  999999998 ";

        void solve()
	{
            int ai=ni(),bi=ni();
            int a[]=na(ai);
            int b[]=na(bi);
            Arrays.sort(a);
            for (int i = 0; i < b.length; i++) {
                int j = b[i];
                if(j<a[0]){
                    System.out.print("0 ");
                    continue;
                }
                else if(j>=a[ai-1]){
                    System.out.print(ai+" ");
                    continue;
                }
                int l=0,r=ai,m;
                while(true){
                    m=(l+r)/2;
                    if(j>a[m]){
                        l=m;
                    }
                    else if(j<a[m]){
                        r=m;
                    }
                    if(m==(r+l)/2) break;
                }
                System.out.print(m+1+" ");
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

    public static void main(String[] args) throws Exception { new Solution().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
        { return !(c >= 33 && c <= 126); }
	private int skip()
        { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

	private String ns()//String
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)//char[n]
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()//long
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="5 4\n" +
"1 3 5 7 9\n" +
"6 4 2 8";

        void solve()
	{
            int ai=ni(),bi=ni();
            int a[]=na(ai);
            int b[]=na(bi);
            Arrays.sort(a);
            for (int i = 0; i < b.length; i++) {
                int j = b[i];
                if(j<a[0]){
                    System.out.print("0 ");
                    continue;
                }
                if(j>a[ai-1]){
                    System.out.print(ai+" ");
                }
                int l=0,r=ai,m;
                while(true){
                    m=(l+r)/2;
                    if(j>a[m]){
                        l=m;
                    }
                    else if(j<a[m]){
                        r=m;
                    }
                    else break;
                    if(m==(r+l)/2) break;
                }
                System.out.print(m+1+" ");
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

    public static void main(String[] args) throws Exception { new Solution().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
        { return !(c >= 33 && c <= 126); }
	private int skip()
        { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

	private String ns()//String
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)//char[n]
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()//long
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="3 2\n" +
"999999999 999999999 999999999 \n" +
"1000000000  999999998 ";

        void solve()
	{
            int ai=ni(),bi=ni();
            int a[]=na(ai);
            Arrays.sort(a);
            for (int i = 0; i < bi; i++) {
                int b = ni();
                int l=0,r=ai-1;
                int m;
                if(b<a[0]){
                    System.out.print("0 ");continue;
                }
                else if(b>=a[ai-1]){
                    System.out.print(ai+" ");continue;
                }
                while(true){
                    m=(r+l)/2;
                    if(b<a[m]){
                        r=m;
                    }
                    else if(b>a[m]){
                        l=m;
                    }
                    else {
                        m++;l=m;
                    }
                    if(m==(l+r)/2)break;
                }
                System.out.print(m+1+" ");
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

    public static void main(String[] args) throws Exception { new Solution().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
        { return !(c >= 33 && c <= 126); }
	private int skip()
        { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

	private String ns()//String
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)//char[n]
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()//long
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);

		//
		int a=s.nextInt();
		int b=s.nextInt();
		Integer arr1[]=new Integer[a];
		int i,j;
		for(i=0;i<a;i++){
			arr1[i]=s.nextInt();
		}
		Arrays.sort(arr1);
		for(i=0;i<b;i++){
			System.out.print(binSearch(arr1,s.nextInt())+" ");
		}
		//

	}
	private static int binSearch(Integer arr[],int number){
		int left=0,right=arr.length-1,mid=(left+right)/2,ind=0;
		while(left<=right){
			if(arr[mid]<=number){
				ind=mid+1;
				left=mid+1;
			}
			else
				right=mid-1;
			mid=(left+right)/2;
		}
		return ind;
	}
}


import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="2 2\n" +
"999999999 999999999 \n" +
"1000000000  999999998 ";

        void solve()
	{
            int ai=ni(),bi=ni();
            int a[]=na(ai);
            int b[]=na(bi);
            Arrays.sort(a);
            for (int i = 0; i < b.length; i++) {
                int j = b[i];
                if(j<a[0]){
                    System.out.print("0 ");
                    continue;
                }
                else if(j>=a[ai-1]){
                    System.out.print(ai+" ");
                    continue;
                }
                int l=0,r=ai,m;
                while(true){
                    m=(l+r)/2;
                    if(j>a[m]){
                        l=m;
                    }
                    else if(j<a[m]){
                        r=m;
                    }
                    else break;
                    if(m==(r+l)/2) break;
                }
                System.out.print(m+1+" ");
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

    public static void main(String[] args) throws Exception { new Solution().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
        { return !(c >= 33 && c <= 126); }
	private int skip()
        { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

	private String ns()//String
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)//char[n]
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()//long
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="5 5\n" +
"1 2 1 2 5\n" +
"3 1 4 -1 8";
    private static HashMap sortValues(HashMap map)
{
List list = new LinkedList(map.entrySet());
//Custom Comparator
Collections.sort(list, new Comparator()
{
public int compare(Object o1, Object o2)
{
return ((Comparable) ((Map.Entry) (o1)).getValue()).compareTo(((Map.Entry) (o2)).getValue());
}
});
//copying the sorted list in HashMap to preserve the iteration order
HashMap sortedHashMap = new LinkedHashMap();
for (Iterator it = list.iterator(); it.hasNext();)
{
 Map.Entry entry = (Map.Entry) it.next();
sortedHashMap.put(entry.getKey(), entry.getValue());
}
return sortedHashMap;
}
        void solve()
	{
            int ai=ni(),bi=ni();
            int a[]=na(ai);
            Arrays.sort(a);
            for (int i = 0; i < bi; i++) {
                System.out.print(binSearch(a, ni())+" ");
            }
        }
        public static int binSearch(int arr[],int number){
		int left=0,right=arr.length-1,mid=(left+right)/2,ind=0;
		while(left<=right){
			if(arr[mid]<=number){
				ind=mid+1;
				left=mid+1;
			}
			else
				right=mid-1;
			mid=(left+right)/2;
		}
		return ind;
	}
	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

    public static void main(String[] args) throws Exception { new Solution().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
        { return !(c >= 33 && c <= 126); }
	private int skip()
        { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

	private String ns()//String
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)//char[n]
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()//long
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="5 5\n" +
"1 2 1 2 5\n" +
"3 1 4 1 5";

        void solve()
	{
            int ai=ni(),bi=ni();
            int a[]=na(ai);
            Arrays.sort(a);
            for (int i = 0; i < bi; i++) {
                int b = ni();
                int l=0,r=ai-1;
                int m;
                if(b<a[0]){
                    System.out.print("0 ");continue;
                }
                else if(b>=a[ai-1]){
                    System.out.print(ai+" ");continue;
                }
                while(true){
                    m=(r+l)/2;
                    if(b<a[m]){
                        r=m;
                    }
                    else if(b>a[m]){
                        l=m;
                    }
                    else {
                        l=m;
                    }
                    if(m==(l+r)/2)break;
                }
                System.out.print(m+1+" ");
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

    public static void main(String[] args) throws Exception { new Solution().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
        { return !(c >= 33 && c <= 126); }
	private int skip()
        { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

	private String ns()//String
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)//char[n]
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()//long
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="5 5\n" +
"1 2 1 2 5\n" +
"3 1 4 -1 8";

        void solve()
	{
            int ai=ni(),bi=ni();
            int a[]=na(ai);
            Arrays.sort(a);
            for (int i = 0; i < bi; i++) {
                int b = ni();
                int l=0,r=ai-1;
                int m;
                if(b<a[0]){
                    System.out.print("0 ");continue;
                }
                else if(b>=a[ai-1]){
                    System.out.print(ai+" ");continue;
                }
                m=(r+l)/2;
                int ans=0;
                while(l<=r){
                    if(b<a[m]){
                        r=m-1;
                    }
                    else if(b>=a[m]){
                        l=m+1;ans=l;
                    }
                    m=(l+r)/2;
                }
                System.out.print(ans+" ");
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

    public static void main(String[] args) throws Exception { new Solution().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
        { return !(c >= 33 && c <= 126); }
	private int skip()
        { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

	private String ns()//String
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)//char[n]
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()//long
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="5 4\n" +
"1 3 5 7 9\n" +
"6 4 2 8";

        void solve()
	{
            int ai=ni(),bi=ni();
            int a[]=na(ai);
            int b[]=na(bi);
            Arrays.sort(a);
            for (int i = 0; i < b.length; i++) {
                int j = b[i];
                int l=0,r=ai,m;
                while(true){
                    m=(l+r)/2;
                    if(j>a[m]){
                        l=m;
                    }
                    else if(j<a[m]){
                        r=m;
                    }
                    else break;
                    if(m==(r+l)/2) break;
                }
                System.out.print(m+1+" ");
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

    public static void main(String[] args) throws Exception { new Solution().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
        { return !(c >= 33 && c <= 126); }
	private int skip()
        { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

	private String ns()//String
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)//char[n]
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()//long
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.util.*;

import java.math.*;

public class Main {

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

	static int n, m;
	static Num[] arr1;
	static int[] arr2;

	public static void main(String args[]) throws Exception {
		FastReader cin = new FastReader();

		n = cin.nextInt();
		m = cin.nextInt();

		arr1 = new Num[n];
		arr2 = new int[m];

		for (int i = 0; i < n; i++) {
			int val = cin.nextInt();
			arr1[i] = new Num(val, i);
		}
		Arrays.parallelSort(arr1, new ValCmp());

		for (int i = 0; i < m; i++) {
			arr2[i] = cin.nextInt();
		}

		for (int i = 0; i < m; i++) {
			search(arr1, arr2[i]);
		}
	}

	public static void search(Num[] arr1, int target) {
		int low = 0;
		int high = n - 1;

		while (low <= high) {
			int mid = (low + high) / 2;

			if (arr1[mid].val == target) {
				if (mid == n - 1) {
					System.out.println(mid + 1 + " ");
					return;
				} else {
					low = mid + 1;
				}
			}
			if (arr1[mid].val < target) {
				low = mid + 1;
			}
			if (arr1[mid].val > target) {
				if (mid - 1 >= 0 && arr1[mid - 1].val <= target) {
					System.out.print(mid + " ");
					return;
				} else {
					high = mid - 1;
				}
			}
		}
		System.out.println(0);
	}
}

class ValCmp implements Comparator<Num> {
	public int compare(Num a, Num b) {
		return a.val - b.val;
	}
}

class Num {
	int val, index;
	public Num(int val, int index) {
		this.val = val;
		this.index = index;
	}
}


import java.io.*;
import java.util.*;

import java.math.*;

public class Main {

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

	static int n, m;
	static Num[] arr1;
	static int[] arr2;

	public static void main(String args[]) throws Exception {
		FastReader cin = new FastReader();

		n = cin.nextInt();
		m = cin.nextInt();

		arr1 = new Num[n];
		arr2 = new int[m];

		for (int i = 0; i < n; i++) {
			int val = cin.nextInt();
			arr1[i] = new Num(val, i);
		}
		Arrays.parallelSort(arr1, new ValCmp());

		for (int i = 0; i < m; i++) {
			arr2[i] = cin.nextInt();
		}

		for (int i = 0; i < m; i++) {
			search(arr1, arr2[i]);
		}
	}

	public static void search(Num[] arr1, int target) {
		int low = 0;
		int high = n - 1;

		while (low <= high) {
			int mid = (low + high) / 2;

			if (arr1[mid].val == target) {
				if (mid == n - 1) {
					System.out.println(mid + 1 + " ");
					return;
				} else {
					low = mid + 1;
				}
			}
			if (arr1[mid].val < target) {
				low = mid + 1;
			}
			if (arr1[mid].val > target) {
				if (mid - 1 >= 0 && arr1[mid - 1].val <= target) {
					System.out.print(mid + " ");
					return;
				} else {
					high = mid - 1;
				}
			}
		}
	}
}

class ValCmp implements Comparator<Num> {
	public int compare(Num a, Num b) {
		return a.val - b.val;
	}
}

class Num {
	int val, index;
	public Num(int val, int index) {
		this.val = val;
		this.index = index;
	}
}


import java.io.*;
import java.util.*;

import java.math.*;

public class Main {

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

	static int n, m;
	static Num[] arr1;
	static int[] arr2;

	public static void main(String args[]) throws Exception {
		FastReader cin = new FastReader();

		n = cin.nextInt();
		m = cin.nextInt();

		arr1 = new Num[n];
		arr2 = new int[m];

		for (int i = 0; i < n; i++) {
			int val = cin.nextInt();
			arr1[i] = new Num(val, i);
		}
		Arrays.parallelSort(arr1, new ValCmp());

		for (int i = 0; i < m; i++) {
			arr2[i] = cin.nextInt();
		}

		for (int i = 0; i < m; i++) {
			search(arr1, arr2[i]);
		}
	}

	public static void search(Num[] arr1, int target) {
		int low = 0;
		int high = n - 1;

		while (low <= high) {
			int mid = (low + high) / 2;

			if (arr1[mid].val == target) {
				if (mid == n - 1) {
					System.out.println(mid + 1 + " ");
					return;
				} else {
					low = mid + 1;
				}
			}
			if (arr1[mid].val < target) {
				low = mid + 1;
			}
			if (arr1[mid].val > target) {
				if (mid - 1 >= 0 && arr1[mid - 1].val <= target) {
					System.out.print(mid + " ");
					return;
				} else {
					high = mid - 1;
				}
			}
		}
		System.out.println(low);
	}
}

class ValCmp implements Comparator<Num> {
	public int compare(Num a, Num b) {
		return a.val - b.val;
	}
}

class Num {
	int val, index;
	public Num(int val, int index) {
		this.val = val;
		this.index = index;
	}
}


import java.util.*;

public class queries{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long m = scan.nextLong();
		long[] arrA = new long[(int)n];
		for(int i = 0;i<n;i++){
			arrA[i] = scan.nextLong();
		}
		merge(arrA,0,n-1);
		for(int i = 0;i<m;i++){
			System.out.print(binary(arrA,scan.nextLong(),0,(int)n-1)+" ");
		}
	}
	static int binary(long[] arrA,long target,int low,int high){
		while(low<=high){
			int mid = (low+high)/2;
			if(arrA[mid]<=target){
				low = mid+1;
			}
			else{
				high = mid-1;
			}
		}
		return high+1;
	}
	public static void merge(long[] arr,long left,long right){
		if(left<right){
		long mid = (left+right)/2;
		merge(arr,left,mid);
		merge(arr,mid+1,right);
		mergeSort(arr,left,mid,right);
		}
	}
	public static void mergeSort(long[] arr,long l,long m,long r){
		long n1 = m-l+1;
		long n2 = r-m;
		long[] left = new long[(int)n1];
		long[] right = new long[(int)n2];
		for(int i = 0;i<n1;i++){
			left[i] = arr[(int)l+i];
		}
		for(int j = 0;j<n2;j++){
			right[j] = arr[(int)m+1+j];
		}

		int i = 0;
		int j = 0;
		long k = l;
		while(i<n1 && j<n2){
			if(left[i]<right[j]){
				arr[(int)k] = left[i];
				i++;
			}
			else{
				arr[(int)k] = right[j];
				j++;
			}
			k++;
		}
		while(i<n1){
			arr[(int)k] = left[i];
			i++;
			k++;
		}
		while(j<n2){
			arr[(int)k] = right[j];
			j++;
			k++;
		}
	}
}


import java.util.*;

public class queries{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		long[] arrA = new long[n];
		long[] arrB = new long[m];
		for(int i = 0;i<n;i++){
			arrA[i] = scan.nextLong();
		}
		Arrays.sort(arrA);
		for(int i = 0;i<m;i++){
			arrB[i] = scan.nextLong();
		}
		for(int i = 0;i<m;i++){
			System.out.print(binary(arrA,arrB[i])+" ");
		}
	}
	static int binary(long[] arrA,long target){
		int low = 0;
		int high = arrA.length-1;
		while(low<=high){
			int mid = (low+high)/2;
			if(arrA[mid]<=target){
				low = mid+1;
			}
			else{
				high = mid-1;
			}
		}
		return high+1;
	}
}


import java.util.*;

public class queries{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		long[] arrA = new long[n];
		for(int i = 0;i<n;i++){
			arrA[i] = scan.nextLong();
		}
		Arrays.sort(arrA);
		for(int i = 0;i<m;i++){
			System.out.print(binary(arrA,scan.nextLong(),0,n-1)+" ");
		}
	}
	static int binary(long[] arrA,long target,int low,int high){
		while(low<=high){
			int mid = (low+high)/2;
			if(arrA[mid]<=target){
				low = mid+1;
			}
			else{
				high = mid-1;
			}
		}
		return high+1;
	}
}


import java.util.*;

public class queries{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long m = scan.nextLong();
		long[] arrA = new long[(int)n];
		for(int i = 0;i<n;i++){
			arrA[i] = scan.nextLong();
		}
		Arrays.sort(arrA);
		for(int i = 0;i<m;i++){
			System.out.print(binary(arrA,scan.nextLong(),0,(int)n-1)+" ");
		}
	}
	static int binary(long[] arrA,long target,int low,int high){
		while(low<=high){
			int mid = (low+high)/2;
			if(arrA[mid]<=target){
				low = mid+1;
			}
			else{
				high = mid-1;
			}
		}
		return high+1;
	}
}


import java.util.*;

public class queries{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		long[] arrA = new long[n];
		for(int i = 0;i<n;i++){
			arrA[i] = scan.nextLong();
		}
		Arrays.sort(arrA);
		for(int i = 0;i<m;i++){
			System.out.print(binary(arrA,scan.nextLong())+" ");
		}
	}
	static int binary(long[] arrA,long target){
		int low = 0;
		int high = arrA.length-1;
		while(low<=high){
			int mid = (low+high)/2;
			if(arrA[mid]<=target){
				low = mid+1;
			}
			else{
				high = mid-1;
			}
		}
		return high+1;
	}
}


import java.util.Scanner;
public class queries {
    public static void main(String[] args) {
        int max = Integer.MIN_VALUE;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int ar[] = new int[n];
        for (int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
            if (ar[i] > max)
                max = ar[i];
        }
        int br[] = new int[m];
        for (int i = 0; i < m; i++) {
            br[i] = sc.nextInt();
        }
        sort(ar,0,ar.length-1);
        for (int i = 0; i < m; i++) {
            int t = br[i];
            if (t >= max) {
                br[i] = ar.length;
            } else {
                int start = 0, end = ar.length - 1;
                while (start < end) {
                    int mid = (start + end) / 2;
                    if (ar[mid] > t) {
                        end = mid;
                    } else {
                        start = mid + 1;
                    }
                }
                br[i] = start;
            }
        }
        for (int i = 0; i <m ; i++) {
            System.out.print(br[i]+" ");
        }
    }
    public static void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int [n1];
        int R[] = new int [n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
    public static void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class queries {
    public static void main(String[] args) {
        int max = Integer.MIN_VALUE;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int ar[] = new int[n];
        for (int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
            if (ar[i] > max)
                max = ar[i];
        }
        int br[] = new int[m];
        for (int i = 0; i < m; i++) {
            br[i] = sc.nextInt();
        }
        for (int i = 0; i < m; i++) {
            int t = br[i];
            if (t >= max) {
                br[i] = ar.length;
            } else {
                Arrays.sort(ar);
                int start = 0, end = ar.length - 1;
                while (start < end) {
                    int mid = (start + end) / 2;
                    if (ar[mid] > t) {
                        end = mid;
                    } else {
                        start = mid + 1;
                    }
                }
                br[i] = start;
            }
        }
        for (int i = 0; i <m ; i++) {
            System.out.print(br[i]+" ");
        }
    }
}


package com.company;
import java.util.Arrays;
import java.util.Scanner;

public class queries {
    public static void main(String[] args) {
        int max = Integer.MIN_VALUE;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int ar[] = new int[n];
        for (int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
            if (ar[i] > max)
                max = ar[i];
        }
        int br[] = new int[m];
        for (int i = 0; i < m; i++) {
            br[i] = sc.nextInt();
        }
        Arrays.sort(ar);
        for (int i = 0; i < m; i++) {
            int t = br[i];
            if (t >= max) {
                br[i] = ar.length;
            } else {
                int start = 0, end = ar.length - 1;
                while (start < end) {
                    int mid = (start + end) / 2;
                    if (ar[mid] > t) {
                        end = mid;
                    } else {
                        start = mid + 1;
                    }
                }
                br[i] = start;
            }
        }
        for (int i = 0; i <m ; i++) {
            System.out.print(br[i]+" ");
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;
public class queries {
    public static void main(String[] args) {
        int max = Integer.MIN_VALUE;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int ar[] = new int[n];
        for (int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
            if (ar[i] > max)
                max = ar[i];
        }
        int br[] = new int[m];
        for (int i = 0; i < m; i++) {
            br[i] = sc.nextInt();
        }
        Arrays.sort(ar);
        for (int i = 0; i < m; i++) {
            int t = br[i];
            if (t >= max) {
                br[i] = ar.length;
            } else {
                int start = 0, end = ar.length - 1;
                while (start < end) {
                    int mid = (start + end) / 2;
                    if (ar[mid] > t) {
                        end = mid;
                    } else {
                        start = mid + 1;
                    }
                }
                br[i] = start;
            }
        }
        for (int i = 0; i <m ; i++) {
            System.out.print(br[i]+" ");
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class queries {
    public static void main(String[] args) {
        int max = Integer.MIN_VALUE;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int ar[] = new int[n];
        for (int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
            if (ar[i] > max)
                max = ar[i];
        }
        int br[] = new int[m];
        for (int i = 0; i < m; i++) {
            br[i] = sc.nextInt();
        }
        for (int i = 0; i < m; i++) {
            int t = br[i];
            if (t >= max) {
                br[i] = ar.length;
            } else {
                Arrays.sort(ar);
                int start = 0, end = ar.length - 1;
                while (start < end) {
                    int mid = (start + end) / 2;
                    if (ar[mid] > t) {
                        end = mid;
                    } else {
                        start = mid + 1;
                    }
                }
                br[i] = start;
            }
        }
        System.out.println(Arrays.toString(br));
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class queries {
    public static void main(String[] args) {
        int max = Integer.MIN_VALUE;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int ar[] = new int[n];
        for (int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
            if (ar[i] > max)
                max = ar[i];
        }
        int br[] = new int[m];
        for (int i = 0; i < m; i++) {
            br[i] = sc.nextInt();
        }
        Arrays.sort(ar);
        for (int i = 0; i < m; i++) {
            int t = br[i];
            if (t >= max) {
                br[i] = ar.length;
            } else {
                int start = 0, end = ar.length - 1;
                while (start < end) {
                    int mid = (start + end) / 2;
                    if (ar[mid] > t) {
                        end = mid;
                    } else {
                        start = mid + 1;
                    }
                }
                br[i] = start;
            }
        }
        for (int i = 0; i <m ; i++) {
            System.out.print(br[i]+" ");
        }
    }
}


import java.io.*;
import java.math.*;
import java.util.*;

public class A {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static long H,W;
    static BitSet bs;
    static long mod = 1000000007;
      // All possible moves of a knight
    static   int X[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
    static int Y[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
    public static void main(String args[]) throws IOException {
    /**
1.What is the unknown:
2.What are the data:
3.What is the condition:
4.What is the restriction:
5. understand the problem:
6. What are the cases edges in the problem:
*/
                int n = in.nextInt();
                int m = in.nextInt();
                int[] a =new int[n];
                Integer [] b = new Integer[m];
                for(int i=0;i<n;i++){
                    a[i] = in.nextInt();

                }
                Arrays.sort(a);
                int sum =0;
                for(int j=0;j<m;j++){
                    out.print(upperBound(in.nextInt(), a)+" ");
                }
                out.flush();
    }
    static int upperBound(int val, int [] a){
        int mid = 0;
        int lo =0;
        int hi = a.length-1;
        while(lo<hi){
            mid = (lo+hi)>>1;
            if(a[mid]>val){
                hi = mid;
            }else{
                lo = mid+1;
            }
        }
        return lo;
    }
    static boolean isVowel(char c){
        if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y'){
            return true;
        }
        return false ;
    }
    static class IP implements Comparable<IP>{
        public int first,second;
        IP(int first, int second){
            this.first = first;
            this.second = second;
        }
        public int compareTo(IP ip){
            if(first==ip.first)
                return second-ip.second;
            return first-ip.first;
        }

    }

       static long gcd(long a, long b){
        return b!=0?gcd(b, a%b):a;
    }

        static boolean isEven(long a) {
            return (a&1)==0;
        }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }

     }
}


import java.io.*;
import java.math.*;
import java.util.*;

public class A {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static long H,W;
    static BitSet bs;
    static long mod = 1000000007;
      // All possible moves of a knight
    static   int X[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
    static int Y[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
    public static void main(String args[]) throws IOException {
    /**
1.What is the unknown:
2.What are the data:
3.What is the condition:
4.What is the restriction:
5. understand the problem:
6. What are the cases edges in the problem:
*/
                int n = in.nextInt();
                int m = in.nextInt();
                int[] a =new int[n];
                Integer [] b = new Integer[m];
                for(int i=0;i<n;i++){
                    a[i] = in.nextInt();

                }
                Arrays.sort(a);
                int sum =0;
                for(int j=0;j<m;j++){
                    int k= in.nextInt();
                    int val = lowerBound(k+1, a);
                    out.print(val+" ");
                }
                out.flush();
    }
    static int lowerBound(int val, int [] a){
        int mid = 0;
        int lo =0;
        int hi = a.length;
        while(lo<hi){
            mid = (lo+hi)>>1;
            if(a[mid]<val){
                lo = mid+1;
            }else{
                hi = mid;
            }
        }
        return lo;
    }
    static boolean isVowel(char c){
        if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y'){
            return true;
        }
        return false ;
    }
    static class IP implements Comparable<IP>{
        public int first,second;
        IP(int first, int second){
            this.first = first;
            this.second = second;
        }
        public int compareTo(IP ip){
            if(first==ip.first)
                return second-ip.second;
            return first-ip.first;
        }

    }

       static long gcd(long a, long b){
        return b!=0?gcd(b, a%b):a;
    }

        static boolean isEven(long a) {
            return (a&1)==0;
        }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }

     }
}


import java.io.*;
import java.math.*;
import java.util.*;

public class A {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static long H,W;
    static BitSet bs;
    static long mod = 1000000007;
      // All possible moves of a knight
    static   int X[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
    static int Y[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
    public static void main(String args[]) throws IOException {
    /**
1.What is the unknown:
2.What are the data:
3.What is the condition:
4.What is the restriction:
5. understand the problem:
6. What are the cases edges in the problem:
*/
                int n = in.nextInt();
                int m = in.nextInt();
                int[] a =new int[n];
                Integer [] b = new Integer[m];
                for(int i=0;i<n;i++){
                    a[i] = in.nextInt();

                }
                Arrays.sort(a);
                int sum =0;
                for(int j=0;j<m;j++){
                    int k= in.nextInt();
                    int val = upperBound(k, a);
                    if(k==a[n-1]){
                        val++;
                    }
                    out.print(val+" ");
                }
                out.flush();
    }
    static int upperBound(int val, int [] a){
        int mid = 0;
        int lo =0;
        int hi = a.length-1;
        while(lo<hi){
            mid = (lo+hi)>>1;
            if(a[mid]>val){
                hi = mid;
            }else{
                lo = mid+1;
            }
        }
        return lo;
    }
    static boolean isVowel(char c){
        if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y'){
            return true;
        }
        return false ;
    }
    static class IP implements Comparable<IP>{
        public int first,second;
        IP(int first, int second){
            this.first = first;
            this.second = second;
        }
        public int compareTo(IP ip){
            if(first==ip.first)
                return second-ip.second;
            return first-ip.first;
        }

    }

       static long gcd(long a, long b){
        return b!=0?gcd(b, a%b):a;
    }

        static boolean isEven(long a) {
            return (a&1)==0;
        }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }

     }
}


import java.io.*;
import java.math.*;
import java.util.*;

public class A {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static long H,W;
    static BitSet bs;
    static long mod = 1000000007;
      // All possible moves of a knight
    static   int X[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
    static int Y[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
    public static void main(String args[]) throws IOException {
    /**
1.What is the unknown:
2.What are the data:
3.What is the condition:
4.What is the restriction:
5. understand the problem:
6. What are the cases edges in the problem:
*/
                int n = in.nextInt();
                int m = in.nextInt();
                int[] a =new int[n];
                Integer [] b = new Integer[m];
                for(int i=0;i<n;i++){
                    a[i] = in.nextInt();

                }
                Arrays.sort(a);
                int sum =0;
                for(int j=0;j<m;j++){
                    int k= in.nextInt();
                    int val = upperBound(k, a);
                    out.print(val+" ");
                }
                out.flush();
    }
    static int upperBound(int val, int [] a){
        int mid = 0;
        int lo =-1;
        int hi = a.length;
        while(lo<hi){
            mid = (lo+hi)>>1;
            if(a[mid]>val){
                hi = mid;
            }else{
                lo = mid+1;
            }
        }
        return lo;
    }
    static boolean isVowel(char c){
        if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y'){
            return true;
        }
        return false ;
    }
    static class IP implements Comparable<IP>{
        public int first,second;
        IP(int first, int second){
            this.first = first;
            this.second = second;
        }
        public int compareTo(IP ip){
            if(first==ip.first)
                return second-ip.second;
            return first-ip.first;
        }

    }

       static long gcd(long a, long b){
        return b!=0?gcd(b, a%b):a;
    }

        static boolean isEven(long a) {
            return (a&1)==0;
        }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }

     }
}


import java.io.*;
import java.math.*;
import java.util.*;

public class A {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static long H,W;
    static BitSet bs;
    static long mod = 1000000007;
      // All possible moves of a knight
    static   int X[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
    static int Y[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
    public static void main(String args[]) throws IOException {
    /**
1.What is the unknown:
2.What are the data:
3.What is the condition:
4.What is the restriction:
5. understand the problem:
6. What are the cases edges in the problem:
*/
                int n = in.nextInt();
                int m = in.nextInt();

               ArrayList<Integer> a = new ArrayList<>(2000000);
                for(int i=0;i<n;i++){
                    a.add(  in.nextInt());

                }
              Collections.sort(a);
                int sum =0;
                for(int j=0;j<m;j++){
                    int k= in.nextInt();
                    int val = lowerBound(k+1, a);
                    out.print(val+" ");
                }
                out.flush();
    }
    static int lowerBound(int val, ArrayList<Integer> a){
        int mid = 0;
        int lo =0;
        int hi = a.size();
        while(lo<hi){
            mid = (lo+hi)>>1;
            if(a.get(mid)<val){
                lo = mid+1;
            }else{
                hi = mid;
            }
        }
        return lo;
    }
    static boolean isVowel(char c){
        if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y'){
            return true;
        }
        return false ;
    }
    static class IP implements Comparable<IP>{
        public int first,second;
        IP(int first, int second){
            this.first = first;
            this.second = second;
        }
        public int compareTo(IP ip){
            if(first==ip.first)
                return second-ip.second;
            return first-ip.first;
        }

    }

       static long gcd(long a, long b){
        return b!=0?gcd(b, a%b):a;
    }

        static boolean isEven(long a) {
            return (a&1)==0;
        }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }

     }
}


import java.util.Arrays;
import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr1 = new int[n];
        int[] arr2 = new int[m];
        for (int i = 0; i < arr1.length; i++) {
            arr1[i] = sc.nextInt();
        }
        for (int i = 0; i < arr2.length; i++) {
            arr2[i] = sc.nextInt();
        }
        Arrays.sort(arr1);
        for (int i = 0; i < arr2.length; i++) {
            int number = binarySearch(arr1, arr2[i]);
            System.out.print(number + " ");
        }
    }

    public static int binarySearch(int[] arr1, int n) {
        int start = 0;
        int end = arr1.length - 1;
        while (start + 1 < end) {
            int mid = (start + end) / 2;
            if (arr1[mid] > n) {
                end = mid - 1;
            } else {
                start = mid;
            }
        }
        if (arr1[end] <= n) {
            return end + 1;
        }
        return start + 1;
    }

//    private static int binarySearch(int[] arr1, int n, int start, int end) {
////        if (start > end) {
////            return -1;
////        }
//        int mid = (start + end) / 2;
//        if (arr1[mid] <= n && arr1[mid + 1] > n) {
//            return mid + 1;
//        }
//        if (arr1[mid] > n) {
//            return binarySearch(arr1, n, start, mid - 1);
//        }
//        return binarySearch(arr1, n, mid, end);
//    }

}


import java.util.PriorityQueue;
import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr1 = new int[n];
        int[] arr2 = new int[m];
        for (int i = 0; i < arr1.length; i++) {
            arr1[i] = sc.nextInt();
        }
        for (int i = 0; i < arr2.length; i++) {
            arr2[i] = sc.nextInt();
        }
        StringBuilder sb = new StringBuilder();
        PriorityQueue<Integer> pq = new PriorityQueue<>();
        for (int i = 0; i < arr1.length; i++) {
            pq.add(arr1[i]);
        }
        int c = 0;
        while (!pq.isEmpty()) {
            arr1[c++] = pq.poll();
        }
        for (int i = 0; i < arr2.length; i++) {
            int number = binarySearch(arr1, arr2[i]);
            sb.append(number + " ");
        }
        System.out.println(sb);
    }

    public static int binarySearch(int[] arr1, int n) {
        int start = 0;
        int end = arr1.length - 1;
        while (start + 1 < end) {
            int mid = (start + end) / 2;
            if (arr1[mid] > n) {
                end = mid - 1;
            } else {
                start = mid;
            }
        }
        if (arr1[end] <= n) {
            return end + 1;
        }
        if (arr1[start] <= n) {
            return start + 1;
        }
        return 0;
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr1 = new int[n];
        int[] arr2 = new int[m];
        for (int i = 0; i < arr1.length; i++) {
            arr1[i] = sc.nextInt();
        }
        for (int i = 0; i < arr2.length; i++) {
            arr2[i] = sc.nextInt();
        }
        StringBuilder sb = new StringBuilder();
        Arrays.sort(arr1);
        for (int i = 0; i < arr2.length; i++) {
            int number = binarySearch(arr1, arr2[i]);
            sb.append(number + " ");
        }
        System.out.println(sb);
    }

    public static int binarySearch(int[] arr1, int n) {
        int start = 0;
        int end = arr1.length - 1;
        while (start + 1 < end) {
            int mid = (start + end) / 2;
            if (arr1[mid] > n) {
                end = mid - 1;
            } else {
                start = mid;
            }
        }
        if (arr1[end] <= n) {
            return end + 1;
        }
        if (arr1[start] <= n) {
            return start + 1;
        }
        return 0;
    }

//    private static int binarySearch(int[] arr1, int n, int start, int end) {
////        if (start > end) {
////            return -1;
////        }
//        int mid = (start + end) / 2;
//        if (arr1[mid] <= n && arr1[mid + 1] > n) {
//            return mid + 1;
//        }
//        if (arr1[mid] > n) {
//            return binarySearch(arr1, n, start, mid - 1);
//        }
//        return binarySearch(arr1, n, mid, end);
//    }

}


import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr1 = new int[n];
        int[] arr2 = new int[m];
        for (int i = 0; i < arr1.length; i++) {
            arr1[i] = sc.nextInt();
        }
        for (int i = 0; i < arr2.length; i++) {
            arr2[i] = sc.nextInt();
        }
        StringBuilder sb = new StringBuilder();
        PriorityQueue<Integer> pq = new PriorityQueue<>();
        for (int i = 0; i < arr1.length; i++) {
            pq.add(arr1[i]);
        }
        int c = 0;
        while (!pq.isEmpty()) {
            arr1[c++] = pq.poll();
        }
        //Arrays.sort(arr1);
        for (int i = 0; i < arr2.length; i++) {
            int number = binarySearch(arr1, arr2[i]);
            sb.append(number + " ");
        }
        System.out.println(sb);
    }

    public static int binarySearch(int[] arr1, int n) {
        int start = 0;
        int end = arr1.length - 1;
        while (start + 1 < end) {
            int mid = (start + end) / 2;
            if (arr1[mid] > n) {
                end = mid - 1;
            } else {
                start = mid;
            }
        }
        if (arr1[end] <= n) {
            return end + 1;
        }
        if (arr1[start] <= n) {
            return start + 1;
        }
        return 0;
    }

//    private static int binarySearch(int[] arr1, int n, int start, int end) {
////        if (start > end) {
////            return -1;
////        }
//        int mid = (start + end) / 2;
//        if (arr1[mid] <= n && arr1[mid + 1] > n) {
//            return mid + 1;
//        }
//        if (arr1[mid] > n) {
//            return binarySearch(arr1, n, start, mid - 1);
//        }
//        return binarySearch(arr1, n, mid, end);
//    }

}


import java.util.Arrays;
import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr1 = new int[n];
        int[] arr2 = new int[m];
        for (int i = 0; i < arr1.length; i++) {
            arr1[i] = sc.nextInt();
        }
        for (int i = 0; i < arr2.length; i++) {
            arr2[i] = sc.nextInt();
        }
        Arrays.sort(arr1);
        for (int i = 0; i < arr2.length; i++) {
            int number = binarySearch(arr1, arr2[i]);
            System.out.print(number + " ");
        }
    }

    public static int binarySearch(int[] arr1, int n) {
        int start = 0;
        int end = arr1.length - 1;
        while (start + 1 < end) {
            int mid = (start + end) / 2;
            if (arr1[mid] > n) {
                end = mid - 1;
            } else {
                start = mid;
            }
        }
        if (arr1[end] <= n) {
            return end + 1;
        }
        if (arr1[start] <= n) {
            return start + 1;
        }
        return 0;
    }

//    private static int binarySearch(int[] arr1, int n, int start, int end) {
////        if (start > end) {
////            return -1;
////        }
//        int mid = (start + end) / 2;
//        if (arr1[mid] <= n && arr1[mid + 1] > n) {
//            return mid + 1;
//        }
//        if (arr1[mid] > n) {
//            return binarySearch(arr1, n, start, mid - 1);
//        }
//        return binarySearch(arr1, n, mid, end);
//    }

}