#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; #define fi first #define se second #define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++) #define rep(i,n) repl(i,0,n) #define each(itr,v) for(auto itr:v) #define pb push_back #define all(x) (x).begin(),(x).end() #define dbg(x) cout<<#x"="<y?x:y) #define mmin(x,y) (x v; UnionFind(int n) : v(n, -1) {} void init(){ for(int i = 0;i < v.size();i++)v[i]=-1; } int find(int x) { return v[x] < 0 ? x : v[x] = find(v[x]); } bool unite(int x, int y) { x = find(x); y = find(y); if (x == y) return false; if (-v[x] < -v[y]) swap(x, y); if (-v[x]==-v[y] && find(x) > find(y)) swap(x,y); v[x] += v[y]; v[y] = x; return true; } bool root(int x) { return v[x] < 0; } bool same(int x, int y) { return find(x) == find(y); } int size(int x) { return -v[find(x)]; } }; int n,m; int main(){ cin.sync_with_stdio(false); cin>>n>>m; UnionFind uf(n); rep(i,m){ int a,b; cin>>a>>b; a--;b--; uf.unite(a,b); } rep(i,n)cout<