# BF solution
n = input()
l = list(n)
for i in range(len(n)-1):
if i % 3 == 2:
l.insert(len(n)-i-1, ',')
print(''.join(l))
# solution 2
print(f"{int(input()):,}")
n = input()
count = 3
res = []
for item in n[::-1]:
res.append(item)
count -= 1
if not count:
res.append(',')
count = 3
if res[-1] == ',':
res.pop()
print(''.join(res[::-1]))