'''
?????? ?? ????????????????: ???????? ?????
?? ?????? ?????? ???? ????? ????? 1?n?10^5 ? ?????? A[1…n] ?? n ????????? ??????????? ?????, ?? ??????????? 10^9, ? ??????? ???????????,
?? ?????? — ????? ????? 1?k?10^5 ? k ??????????? ????? b1,…,bk, ?? ??????????? 10^9.
??? ??????? i ?? 1 ?? k ?????????? ??????? ?????? 1?j?n, ??? ???????? A[j]=bi, ??? ?1, ???? ?????? j ???.
'''
def binarySearch(A, k):
    l = 0
    r = len(A)-1
    while l <= r:
        m = (l+r)//2
        if A[m] == k:
            return m+1
        elif A[m] > k:
            r = m - 1
        else:
            l = m + 1
    return -1

n = input().split()
k = input().split()
A = []
B = []

for i in n[1:]:
    A.append(int(i))
for i in k[1:]:
    B.append(int(i))

for x in B:
    print(binarySearch(A, x), end=' ')

3c5f6d36076f0bf11cf979c65ace2116f37f907f
<mask token>

<mask token>


def binarySearch(A, k):
    l = 0
    r = len(A) - 1
    while l <= r:
        m = (l + r) // 2
        if A[m] == k:
            return m + 1
        elif A[m] > k:
            r = m - 1
        else:
            l = m + 1
    return -1


<mask token>

<mask token>


def binarySearch(A, k):
    l = 0
    r = len(A) - 1
    while l <= r:
        m = (l + r) // 2
        if A[m] == k:
            return m + 1
        elif A[m] > k:
            r = m - 1
        else:
            l = m + 1
    return -1


<mask token>
for i in n[1:]:
    A.append(int(i))
for i in k[1:]:
    B.append(int(i))
for x in B:
    print(binarySearch(A, x), end=' ')

<mask token>


def binarySearch(A, k):
    l = 0
    r = len(A) - 1
    while l <= r:
        m = (l + r) // 2
        if A[m] == k:
            return m + 1
        elif A[m] > k:
            r = m - 1
        else:
            l = m + 1
    return -1


n = input().split()
k = input().split()
A = []
B = []
for i in n[1:]:
    A.append(int(i))
for i in k[1:]:
    B.append(int(i))
for x in B:
    print(binarySearch(A, x), end=' ')

'''
?????? ?? ????????????????: ???????? ?????
?? ?????? ?????? ???? ????? ????? 1?n?10^5 ? ?????? A[1…n] ?? n ????????? ??????????? ?????, ?? ??????????? 10^9, ? ??????? ???????????,
?? ?????? — ????? ????? 1?k?10^5 ? k ??????????? ????? b1,…,bk, ?? ??????????? 10^9.
??? ??????? i ?? 1 ?? k ?????????? ??????? ?????? 1?j?n, ??? ???????? A[j]=bi, ??? ?1, ???? ?????? j ???.
'''
def binarySearch(A, k):
    l = 0
    r = len(A)-1
    while l <= r:
        m = (l+r)//2
        if A[m] == k:
            return m+1
        elif A[m] > k:
            r = m - 1
        else:
            l = m + 1
    return -1

n = input().split()
k = input().split()
A = []
B = []

for i in n[1:]:
    A.append(int(i))
for i in k[1:]:
    B.append(int(i))

for x in B:
    print(binarySearch(A, x), end=' ')
