// NOTE: it is recommended to use this even if you don't understand the following code.

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

// constraints
#define MAXN 5005
#define MAXK 5005

// input data
int N, K, i;
int P[MAXN], L[MAXK];

int main() {
//  uncomment the following lines if you want to read/write from files
//  freopen("input.txt", "r", stdin);
//  freopen("output.txt", "w", stdout);

    assert(3 == scanf("%d%d%d", &N, &K));

    for(i = 0; i < N; i++) {
        assert(1 == scanf("%d", &P[i]));
    }

    for(i = 0; i < K; i++) {
        assert(1 == scanf("%d", &L[i]));
    }


    // insert your code here


	for(i = 0; i < N; i++){
		printf("%d ", P[i]);
	}
    printf("\n");

    return 0;
}
