#include <stdio.h>
#include <stdlib.h>
#define MAXN 10005
int main() {
int N, M;
scanf("%d", &N);
int main_scores[MAXN];
for (int i = 0; i < N; i++) {
scanf("%d", &main_scores[i]);
}
scanf("%d", &M);
int reply_scores[MAXN];
for (int i = 0; i < M; i++) {
scanf("%d", &reply_scores[i]);
}
int combined_scores[MAXN + MAXN];
int idx = 0;
for (int i = 0; i < N; i++) {
combined_scores[idx++] = main_scores[i];
}
for (int i = 0; i < M; i++) {
combined_scores[idx++] = reply_scores[i];
}
int rank[MAXN + MAXN];
for (int i = 0; i < idx; i++) {
rank[i] = 1;
for (int j = 0; j < idx; j++) {
if (i!= j && combined_scores[i] < combined_scores[j]) {
rank[i]++;
}
}
}
for (int i = N; i < idx; i++) {
printf("%d ", rank[i]);
}
return 0;
}