// AOJ 1367: Rearranging a Sequence
// 2017.10.9 bal4u@uu

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

typedef struct { int id, a; } T;
T tbl[200002];

char buf[35], *p;

int cmp(T *a, T *b) { return b->id - a->id; }	// for qsort()

int main()
{
	int n, m, i, j;
	register T *tp;

//	scanf("%d%d", &n, &m);
	fgets(p = buf, 32, stdin);
	n = atoi(p); while (*p >= '0') p++;
	m = atoi(p); 

	for (tp = tbl+1, j = n, i = 1; j; tp++) tp->id = j--, tp->a = i++;

	while (m--) {
//		scanf("%d", &j);
		fgets(p = buf, 32, stdin);
		j = 0; 	while (*p >= '0') j = (j<<3) + (j<<1) + (*p++ & 0xf);

		tbl[j].id = i++;
	}
	qsort(tbl+1, n, sizeof(T), cmp);
	tp = tbl; while (n--) tp++, printf("%d\n", tp->a);
	return 0;
}