#include<cstdio>
#include<algorithm>
using namespace std;

int main(void)
{
	int people[21];
	int peoples[21];
	int n,m;
	int x,y,kari;
	while(scanf("%d%d",&m,&n) != EOF)
	{
		for(int i = 1;i <= m;i++)
		{
			people[i] = i;
			peoples[i] = i;
		}
		swap(people[2],people[m]);
		peoples[2] = m;
		peoples[m] = 2;
		for(int i = 0;i < n;i++)
		{
			scanf("%d%d",&x,&y);
			if(peoples[y] < peoples[x])
			{
				swap(peoples[y] , peoples[x]);
				swap(people[peoples[x]],people[peoples[y]]);
			}
		}
		for(int i = 1;i <= m;i++)
		{
			printf("%d\n",people[i]);
		}
	}
	return 0;
}