a = input().split(',') a1 = int(a[0]) a2 = int(a[1]) a3 = int(a[2]) a4 = int(a[3]) big = max(a1,a2,a3,a4) small = min(a1,a2,a3,a4) mid = big - small print(str(big) + ',' + str(small) + ',' + str(mid))