#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(a) a.begin(),a.end() #define vi vector #define vvi vector #define P pair class UnionFind{ private: vector data; public: UnionFind(int n):data(n,-1){ } int Root(int x){ return data[x]<0?x:data[x]=Root(data[x]); } int Size(int x){ return -data[Root(x)]; } bool Find(int x,int y){ return Root(x)==Root(y); } void Unite(int x,int y){ x=Root(x); y=Root(y); if(x==y){ return; } if(Size(x) "; #endif } int main(){ int n,m;Prompt();cin>>n>>m; UnionFind unionFind(n); REP(i,m){ int a,b;Prompt();cin>>a>>b;a--;b--; a=unionFind.Root(a); b=unionFind.Root(b); if(unionFind.Size(a)==unionFind.Size(b)){ if(a>b){ swap(a,b); } unionFind.Unite(a,b); }else{ unionFind.Unite(a,b); } } REP(i,n){ cout<