A string S is called special when both of the following hold.
- Every character of S is '0' or '1'.
- For every way of cutting S into two non-empty parts U and V with S = UV, U comes before V in lexicographic order.
For example, S = "00101" is special, because "0" < "0101", "00" < "101", "001" < "01" and "0010" < "1" all hold. A string of length 1 cannot be cut into two parts, so "0" and "1" are both special.
You are given a special string S of length N. Sort every special string of length N in lexicographic order and report the string that comes immediately after S.