#include <fstream>
#define M 50003
using namespace std;
ifstream g("sortaret.in");
ofstream o("sortaret.out");
int n,m,n1,n2,stiva[M],ul,viz[M];
struct nod{
int x;
nod *urm;
};
nod *L[M];
void uneste(int i, int j)
{
nod *p;
p=new nod;
p->x=j;
p->urm=L[i];
L[i]=p;
}
void afis_lista()
{
nod *p;
p=new nod;
for(int i=1;i<=n;i++)
{
p=L[i];
while(p)
{
o<<p->x<<" ";
p=p->urm;
}
o<<"\n";
}
}
void sortare(int nod_start)
{
nod *p;
p=new nod;
p=L[nod_start];
viz[nod_start]=1;
while(p)
{
if(viz[p->x]==0)
{
sortare(p->x);
}
p=p->urm;
}
stiva[++ul]=nod_start;
}
int main()
{
g>>n>>m;
for(int i=1;i<=m;i++)
{
g>>n1>>n2;
uneste(n1,n2);
}
// afis_lista();
sortare(1);
for(int i=1;i<=n;i++)
o<<stiva[i]<<" ";
return 0;
}