#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<complex>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
class UF{
public:
  int o[200100];
  int u[200100];
  UF(int n){
    for(int i=0;i<n;i++){
      o[i]=-1;
      u[i]=i;
    }
  }
  int root(int s){
    while(o[s]>=0)
      s=o[s];
    return u[s];
  }
  void merge(int x, int y){
    x = root(x);
    y = root(y);
    if(x == y) return;
    o[x]+=o[y];
    o[y]=x;
  }
  bool same(int x,int y){
    return root(x) == root(y);
  }
};
int main(){
  int m,n;
  cin>>m>>n;
  UF uni(n+10);
  int player[21]={};
  for(int i=0;i<n;i++){
    int x,y;cin>>x>>y;
    if(player[x]==0&&player[y]==0){
      player[x]==1;player[y]=2;
      uni.merge(x,y);
    }else if(player[x]==0){
      if(player[y]==1){
	player[x]=1;
	for(int j=1;j<=n;j++){
	  if(uni.same(y,j)){
	    player[j]++;
	  }
	}
	uni.merge(x,y);
      }
    }else if(player[y]==0){
      player[y]=player[x]+1;
      uni.merge(x,y);
    }else if(player[x]>=player[y]){
      for(int j=1;j<=n;j++){
	if(uni.same(y,j)){
	  player[j]+=x;
	}
      }
      uni.merge(x,y);
    }else{
      uni.merge(x,y);
    }
  }
  for(int i=1;i<=20;i++){
    for(int j=1;j<=m;j++){
      if(player[j]==i)
	cout<<j<<endl;
    }
  }
  return 0;
}

