#include #define mp make_pair #define pb push_back #define REP(i,a,n) for(int i = a;i < (n);i++) #define RREP(i,a) for(int i = a;i >= 0;i--) #define rep(i,n) for(int i = 0;i < (n);i++) #define rrep(i,n) for(int i = n - 1;i >= 0;i--) #define all(s) s.begin(), s.end() #define rall(s) s.rbegin(), s.rend() #define range(x,min,max) ((min) <= (x) && (x) <= (max)) #define xyrange(x, minX, maxX, y, minY, maxY) (range(x, minX, maxX) && range(y, minY, maxY)) using namespace std; typedef long long LL; typedef vector VI; typedef vector > VVI; typedef vector VS; typedef vector VB; typedef pair PII; typedef vector VPII; const int DX[]={1,0,-1,0},DY[]={0,-1,0,1}; const int INF = 0x3f3f3f3f; VVI edges(100010); VB buy(100010, true); int n, m; VI as, bs; string solve() { string ans; rrep (i, n) { buy[i] = false; rep (j, edges[i].size()) { int idx = edges[i][j]; // 頂点iからいける頂点idx if (!buy[idx]) { buy[i] = true; continue; } } } rep (i, n) { ans = (buy[i]? '1' : '0') + ans; } rep (i, n) { if (ans[i] == '1') { return ans.substr(i); } } return "0"; } int main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> n >> m; rep (i, m) { int a, b; cin >> a >> b; as.pb(a); bs.pb(b); edges[a].pb(b); edges[b].pb(a); } cout << solve() << endl; return 0; }