#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;

struct P
{
	vector<int> ans;
	int used[21]={};
	int front;
	int m;
};

int main()
{
	int m,n;
	int f[21][21]={{}};
	vector<int> ans;
	
	cin>>m>>n;
	for(int i=0;i<n;i++)
	{
		int x,y;
		cin>>x>>y;
		f[x][y]=1;
	}
	
	queue<P> que;
	P p;
	p.ans.push_back(2);
	p.front = 2;
	p.used[2]=1;
	p.m=1;
	
	que.push(p);
	
	while(!que.empty())
	{
		P now = que.front();
		que.pop();
		if(now.m==m)
		{
			ans = now.ans;
			break;
		}
		for(int i=1;i<=m;i++)
		{
			if(now.used[i])continue;
			bool ok = true;
			for(int j=1;j<=m;j++)
			{
				if(f[i][j]&&now.used[j])
				{
					P next=now;
					next.ans.push_back(i);
					next.front=i;
					next.used[i]=1;
					next.m++;
					que.push(next);
				}
			}
		}
	}
	for(int i=0;i<ans.size();i++)
	{
		cout<<ans[i]<<endl;
	}
}