- 메모리 : 31100 KB
- 시간 : 84 ms
def split(stick, index):
size = len(stick)
if size == 3 and index != 1:
return '- -'
elif size >= 3 and index == 1:
return stick.replace('-', ' ')
lst = []
for i in range(0, size, size // 3):
lst.append(bar[i:i+size//3])
answer = split(lst[0], 0) + split(lst[1], 1) + split(lst[2], 2)
return answer
while 1:
try:
n = int(input())
except EOFError:
break
num = 3 ** n
if num == 1:
print('-')
continue
bar = '-' * num
lst = split(bar, 0)
print(lst)