n,k = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) choice = [1]*n d = [[a[i]-b[i],i] for i in range(n)] from operator import itemgetter d.sort(key=itemgetter(0),reverse=True) for i in range(k): choice[d[i][1]] = 0 print(''.join([chr(ord('A')+i) for i in choice]))