#include <iostream>
using namespace std;

typedef struct p {
    int id;
    struct p *next;
} person;

person* insert(person *before, person *obj){
    obj->next = before->next;
    before->next = obj;
    return obj;
}

person* makePerson(int id){
    person *p = (person*)malloc(sizeof(person));
    p->id = id;
    p->next = NULL;
    return p;
}

int main(){
    int m, n;
    int x, y;
    
    person* pTop;
    person* pNow;
    person* pNew;

    pTop = makePerson(2);
    pNow = pTop;
    
    cin >> m >> n;
    for (int i = 0; i < n; i++){
	cin >> x >> y;
	

	bool exists = false;
	pNow = pTop;
	while (pNow != NULL){
	    if (pNow->id == x) exists = true;
	    pNow = pNow->next;
	}

	if (!exists){
	    pNew = makePerson(x);
	    pNow = pTop;
	    while (pNow->next != NULL && pNow->id != y) pNow = pNow->next;
	    insert(pNow, pNew);
	}
    }
    pNow = pTop;
    int l[21] = {0};
    int i = 0;
    while (pNow != NULL){
	l[i] = pNow->id;
	pNow = pNow->next;
	i++;
    }
    i--;
    while (1){
	cout << l[i] << endl;
	if (i == 0) break;
	i--;
    }
}