import java.util.Arrays ;
import java.util.Scanner ;
public class QueriesAboutLessOrEqual {
public static void main
( String [ ] args
) { Scanner sc
= new Scanner
( System .
in ) ;
int n = sc.nextInt ( ) ;
int m = sc.nextInt ( ) ;
int [ ] a = new int [ n] ;
int [ ] b = new int [ m] ;
for ( int i = 0 ; i < n; ++ i) {
a[ i] = sc.nextInt ( ) ;
}
for ( int i = 0 ; i < m; ++ i) {
b[ i] = sc.nextInt ( ) ;
}
for ( int i = 0 ; i < m; ++ i) {
sb.append ( binarySearchGreater( a, b[ i] ) ) ;
sb.append ( " " ) ;
}
}
private static int binarySearchGreater( int [ ] a, int val) {
int start = 0 ;
int end = a.length ;
int middle = 0 ;
while ( start < end) {
middle = start + ( end - start) / 2 ;
if ( a[ middle] == val) {
if ( middle + 1 >= a.length || a[ middle + 1 ] > val) {
return middle + 1 ;
}
start = middle + 1 ;
}
else if ( val > a[ middle] ) {
start = middle + 1 ;
}
else {
end = middle;
}
}
if ( a[ middle] > val) {
return middle;
}
return middle + 1 ;
}
}
aW1wb3J0IGphdmEudXRpbC5BcnJheXM7CmltcG9ydCBqYXZhLnV0aWwuU2Nhbm5lcjsKCnB1YmxpYyBjbGFzcyBRdWVyaWVzQWJvdXRMZXNzT3JFcXVhbCB7CgogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIFNjYW5uZXIgc2MgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoKICAgICAgICBpbnQgbiA9IHNjLm5leHRJbnQoKTsKICAgICAgICBpbnQgbSA9IHNjLm5leHRJbnQoKTsKCiAgICAgICAgaW50W10gYSA9IG5ldyBpbnRbbl07CiAgICAgICAgaW50W10gYiA9IG5ldyBpbnRbbV07CgogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgKytpKSB7CiAgICAgICAgICAgIGFbaV0gPSBzYy5uZXh0SW50KCk7CiAgICAgICAgfQoKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG07ICsraSkgewogICAgICAgICAgICBiW2ldID0gc2MubmV4dEludCgpOwogICAgICAgIH0KCiAgICAgICAgQXJyYXlzLnNvcnQoYSk7CiAgICAgICAgU3RyaW5nQnVmZmVyIHNiID0gbmV3IFN0cmluZ0J1ZmZlcigpOwogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbTsgKytpKSB7CiAgICAgICAgICAgIHNiLmFwcGVuZChiaW5hcnlTZWFyY2hHcmVhdGVyKGEsIGJbaV0pKTsKICAgICAgICAgICAgc2IuYXBwZW5kKCIgIik7CiAgICAgICAgfQogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihzYik7CiAgICB9CgogICAgcHJpdmF0ZSBzdGF0aWMgaW50IGJpbmFyeVNlYXJjaEdyZWF0ZXIoaW50W10gYSwgaW50IHZhbCkgewoKICAgICAgICBpbnQgc3RhcnQgPSAwOwogICAgICAgIGludCBlbmQgPSBhLmxlbmd0aDsKICAgICAgICBpbnQgbWlkZGxlID0gMDsKCiAgICAgICAgd2hpbGUgKHN0YXJ0IDwgZW5kKSB7CiAgICAgICAgICAgIG1pZGRsZSA9IHN0YXJ0ICsgKGVuZCAtIHN0YXJ0KSAvIDI7CiAgICAgICAgICAgIGlmIChhW21pZGRsZV0gPT0gdmFsKSB7CiAgICAgICAgICAgICAgICBpZiAobWlkZGxlICsgMSA+PSBhLmxlbmd0aCB8fCBhW21pZGRsZSArIDFdID4gdmFsKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1pZGRsZSArIDE7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBzdGFydCA9IG1pZGRsZSArIDE7CgogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKHZhbCA+IGFbbWlkZGxlXSkgewogICAgICAgICAgICAgICAgc3RhcnQgPSBtaWRkbGUgKyAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgZW5kID0gbWlkZGxlOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBpZiAoYVttaWRkbGVdID4gdmFsKSB7CiAgICAgICAgICAgIHJldHVybiBtaWRkbGU7CiAgICAgICAgfQogICAgICAgIHJldHVybiBtaWRkbGUgKyAxOwogICAgfQoKfQo=