def fn():
def maxim(level):
max = 0
for i in range(1, level):
if stack[i] > max:
max = stack[i]
return max
def display(level):
global fout
maxi = maxim(n+1)
for i in range(1, maxi+1):
for j in range(1, n+1):
if stack[j] == i:
print(j, end ="")
#fout.write(str(j))
print("*", end="")
#fout.write("*")
print()
#fout.write("\n")
def solve(level):
for i in range(1, maxim(level)+1+1):
stack[level] = i
if level == n:
display(level)
else:
solve(level+1)
global fout
#fin = open("partitiimultime.in","r")
#fout = open("partitiimultime.out","w")
#n = int(fin.readline())
n = int(input())
stack = [0] * (n+1)
stack[1] = 1
solve(2)
fn()
# your code goes here
ZGVmIGZuKCk6CiAgICBkZWYgbWF4aW0obGV2ZWwpOgogICAgICAgIG1heCA9IDAKICAgICAgICBmb3IgaSBpbiByYW5nZSgxLCBsZXZlbCk6CiAgICAgICAgICAgIGlmIHN0YWNrW2ldID4gbWF4OgogICAgICAgICAgICAgICAgbWF4ID0gc3RhY2tbaV0KICAgICAgICByZXR1cm4gbWF4CiAgICBkZWYgZGlzcGxheShsZXZlbCk6CiAgICAgICAgZ2xvYmFsIGZvdXQKICAgICAgICBtYXhpID0gbWF4aW0obisxKQogICAgICAgIGZvciBpIGluIHJhbmdlKDEsIG1heGkrMSk6CiAgICAgICAgICAgIGZvciBqIGluIHJhbmdlKDEsIG4rMSk6CiAgICAgICAgICAgICAgICBpZiBzdGFja1tqXSA9PSBpOgogICAgICAgICAgICAgICAgICAgIHByaW50KGosIGVuZCA9IiIpCiAgICAgICAgICAgICAgICAgICAgI2ZvdXQud3JpdGUoc3RyKGopKQogICAgICAgICAgICBwcmludCgiKiIsIGVuZD0iIikKICAgICAgICAgICAgI2ZvdXQud3JpdGUoIioiKQogICAgICAgIHByaW50KCkKICAgICAgICAjZm91dC53cml0ZSgiXG4iKQoKICAgIGRlZiBzb2x2ZShsZXZlbCk6CiAgICAgICAgZm9yIGkgaW4gcmFuZ2UoMSwgbWF4aW0obGV2ZWwpKzErMSk6CiAgICAgICAgICAgIHN0YWNrW2xldmVsXSA9IGkKICAgICAgICAgICAgaWYgbGV2ZWwgPT0gbjoKICAgICAgICAgICAgICAgIGRpc3BsYXkobGV2ZWwpCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBzb2x2ZShsZXZlbCsxKQogICAgZ2xvYmFsIGZvdXQKICAgICNmaW4gPSBvcGVuKCJwYXJ0aXRpaW11bHRpbWUuaW4iLCJyIikKICAgICNmb3V0ID0gb3BlbigicGFydGl0aWltdWx0aW1lLm91dCIsInciKQogICAgI24gPSBpbnQoZmluLnJlYWRsaW5lKCkpCiAgICBuID0gaW50KGlucHV0KCkpCiAgICBzdGFjayA9IFswXSAqIChuKzEpCiAgICBzdGFja1sxXSA9IDEKICAgIHNvbHZlKDIpCmZuKCkKIyB5b3VyIGNvZGUgZ29lcyBoZXJl