def fn4() -> None:
def solve( n ) -> None:
k = 2 ** n
for i in range(1, k):
for j in range(0, n):
if (1<<j)&i:
print(j+1, end = " ")
print()
n = 3
solve( n )
fn4()
ZGVmIGZuNCgpIC0+IE5vbmU6CgkKICAgIGRlZiBzb2x2ZSggbiApIC0+IE5vbmU6CgogICAgICAgIGsgPSAyICoqIG4KICAgICAgICAKICAgICAgICBmb3IgaSBpbiByYW5nZSgxLCBrKToKICAgICAgICAgICAgCiAgICAgICAgICAgIGZvciBqIGluIHJhbmdlKDAsIG4pOgogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBpZiAoMTw8aikmaTogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgIHByaW50KGorMSwgZW5kID0gIiAiKQogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICBwcmludCgpCgogICAgbiA9IDMKICAgIAogICAgc29sdmUoIG4gKQogICAgCmZuNCgpCg==