import std.algorithm; import std.array; import std.ascii; import std.container; import std.conv; import std.math; import std.numeric; import std.range; import std.stdio; import std.string; import std.typecons; void log(A...)(A arg) { stderr.writeln(arg); } int size(T)(in T s) { return cast(int)s.length; } void main() { int N, M; readf("%d %d\n", &N, &M); auto G = new int[][N]; int R = M; // remainings; foreach (int i; 0 .. M) { int a, b; readf("%d %d\n", &a, &b); G[a] ~= i; G[b] ~= i; } auto count = new int[M]; auto ans = new bool[N]; ans[] = true; foreach (int i; 0 .. N) { foreach (edgeid; G[i]) { count[edgeid]++; } } foreach_reverse (int i; 0 .. N) { foreach (edgeid; G[i]) { count[edgeid]--; } bool C() { foreach (edgeid; G[i]) { if (count[edgeid] <= 0) { return false; } } return true; } if (C()) { ans[i] = false; } else { foreach (edgeid; G[i]) { count[edgeid]++; } } } ans.reverse; bool first = true; foreach (x; ans) { if (x == false) { if (first) continue; write(0); } else { first = false; write(1); } } writeln(); }