import collections
import sys

def read_a_integer():
    return int(sys.stdin.readline())

def read_a_list(dtype):
    return list(map(dtype, sys.stdin.readline().split()))

def main():
    raw = sys.stdin.readline().strip()
    ans = ""
    if raw[0] == "-":
        ans += "("
        raw = raw[1:]
    ans += "$"
    raw = raw.split(".")
    if len(raw) == 2:
        integer, decimal = raw
    else:
        integer = raw[0]
        decimal = ""
    i = len(integer) - 3
    num = ""
    if i < 0:
        num = integer
    # print(num, integer, i)
    while i >= 0:
        # print('num before', num)
        if len(num):
            num = "," + num
        num = integer[i: i + 3] + num
        # print(i, num)
        i -= 3
        if -2 <= i < 0:
            num = integer[:i+3] + "," + num

    decimal = (decimal + "00")[:2]
    ans += num + "." + decimal

    if ans[0] == "(":
        ans += ")"
    print(ans)
    


if __name__ == "__main__":
    main()
