29 lines
644 B
Python
29 lines
644 B
Python
def split_and_join(line):
|
|
full = []
|
|
current = ''
|
|
line_len = len(line)
|
|
for c in range(line_len):
|
|
char = line[c]
|
|
if char == ' ':
|
|
full.append(current)
|
|
current = ''
|
|
else:
|
|
current = current + char
|
|
|
|
if c == line_len - 1:
|
|
full.append(str(current))
|
|
|
|
full_final = ''
|
|
full_len = len(full)
|
|
for v in range(full_len):
|
|
val = full[v]
|
|
full_final += val + ('' if v == full_len-1 else '-')
|
|
|
|
return full_final
|
|
|
|
if __name__ == '__main__':
|
|
line = input()
|
|
result = split_and_join(line)
|
|
print(result)
|
|
|