n, m = map(int, input().split()) edges = {node: set() for node in range(n)} abs_nodes = set() for _ in range(m): smaller, larger = sorted(map(int, input().split())) edges[larger].add(smaller) for node in range(n-1, -1, -1): if node in abs_nodes: continue abs_nodes |= edges[node] ans = 0 for node in abs_nodes: ans |= 1 << node print(format(ans, 'b'))