import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));
PrintWriter cout = new PrintWriter(new OutputStreamWriter(System.out));
String[] words1,words2,words3;
words1 = cin.readLine().split(" ");
words2 = cin.readLine().split(" ");
words3 = cin.readLine().split(" ");
int n = Integer.parseInt(words1[0]),m = Integer.parseInt(words1[1]);
int[] seq = new int[n];
int[] sel = new int[m];
for (int i = 0; i < n; i++) {
seq[i] = Integer.parseInt(words2[i]);
}
for (int i = 0; i < m; i++) {
sel[i] = Integer.parseInt(words3[i]);
}
for (int i = 0; i < words3.length; i++) {
int l = 0, r = n-1,mid = 0;
while (l<r) {
mid = (l+r)/2;
if (seq[mid] >= sel[i]) {
r = mid;
}else {
l = mid+1;
}
}
if (seq[l] == sel[i]) {
cout.print((l+1)+" ");
}else {
cout.print("-1 ");
}
}
cout.flush();
}
}