#include <iostream>
#include <list>
#include <algorithm>

#define rep(X, Y) for( int X = 0; X < Y; ++X )

typedef std::list<int>::iterator list_it;

std::list<int> l;
list_it it;
bool used[21];

int main(){
	int n, m;
	int tmp[2];

	std::cin >> n >> m;

	rep( i, n ) l.push_back( i + 1 );

	while( m-- ){
		//std::cout << "{" << std::endl;
		it = l.end();
		std::cin >> tmp[0] >> tmp[1];

		for( list_it ite = l.begin(); ite != l.end(); ++ite ){
			if( it == l.end() && *ite == tmp[1] )break;
			
			if( *ite == tmp[0] ) it = ite;
			if( *ite == tmp[1] ){
				l.erase( ite );
				l.insert( it, tmp[1] );
			}
			
		}

		/*for( list_it ite = l.begin(); ite != l.end(); ++ite ){
			std::cout << "	" << *ite << std::endl;
		}
		std::cout << "}" << std::endl;*/
	}

	for( list_it ite = l.begin(); ite != l.end(); ++ite ){
		std::cout << *ite << std::endl;
	}
	

	return 0;
}