N = input() S = "" n = len(N) for i in range(1,n+1): S += N[-i] if i % 3 == 0 and i != n: S += ',' print(S[::-1]) #後ろから1つずつ