For some time the program of rounding numbers that had been developed by the Codeforces participants during one of the previous rounds, helped the citizens of Far Far Away to convert numbers into a more easily readable format. However, as time went by, the economy of the Far Far Away developed and the scale of operations grew. So the King ordered to found the Bank of Far Far Away and very soon even the rounding didn't help to quickly determine even the order of the numbers involved in operations. Besides, rounding a number to an integer wasn't very convenient as a bank needed to operate with all numbers with accuracy of up to 0.01, and not up to an integer.

The King issued yet another order: to introduce financial format to represent numbers denoting amounts of money. The formal rules of storing a number in the financial format are as follows: 

  * A number contains the integer part and the fractional part. The two parts are separated with a character "." (decimal point). 
  * To make digits in the integer part of a number easier to read, they are split into groups of three digits, starting from the least significant ones. The groups are separated with the character "," (comma). For example, if the integer part of a number equals 12345678, then it will be stored in the financial format as 12,345,678 
  * In the financial format a number's fractional part should contain exactly two digits. So, if the initial number (the number that is converted into the financial format) contains less than two digits in the fractional part (or contains no digits at all), it is complemented with zeros until its length equals 2. If the fractional part contains more than two digits, the extra digits are simply discarded (they are not rounded: see sample tests). 
  * When a number is stored in the financial format, the minus sign is not written. Instead, if the initial number had the minus sign, the result is written in round brackets. 
  * Please keep in mind that the bank of Far Far Away operates using an exotic foreign currency — snakes ($), that's why right before the number in the financial format we should put the sign "$". If the number should be written in the brackets, then the snake sign should also be inside the brackets. 



For example, by the above given rules number 2012 will be stored in the financial format as "$2,012.00" and number -12345678.9 will be stored as "($12,345,678.90)".

The merchants of Far Far Away visited you again and expressed much hope that you supply them with the program that can convert arbitrary numbers to the financial format. Can you help them?

Input

The input contains a number that needs to be converted into financial format. The number's notation length does not exceed 100 characters, including (possible) signs "-" (minus) and "." (decimal point). The number's notation is correct, that is: 

  * The number's notation only contains characters from the set {"0" – "9", "-", "."}. 
  * The decimal point (if it is present) is unique and is preceded and followed by a non-zero quantity on decimal digits 
  * A number cannot start with digit 0, except for a case when its whole integer part equals zero (in this case the integer parts is guaranteed to be a single zero: "0"). 
  * The minus sign (if it is present) is unique and stands in the very beginning of the number's notation 
  * If a number is identically equal to 0 (that is, if it is written as, for example, "0" or "0.000"), than it is not preceded by the minus sign. 
  * The input data contains no spaces. 
  * The number's notation contains at least one decimal digit. 

Output

Print the number given in the input in the financial format by the rules described in the problem statement.

Examples

Input

2012


Output

$2,012.00

Input

0.000


Output

$0.00

Input

-0.00987654321


Output

($0.00)

Input

-12345678.9


Output

($12,345,678.90)

Note

Pay attention to the second and third sample tests. They show that the sign of a number in the financial format (and consequently, the presence or absence of brackets) is determined solely by the sign of the initial number. It does not depend on the sign of the number you got after translating the number to the financial format.

Source: codeforces | Difficulty: EASY
Tags: String algorithms

Implementation


Solutions:
import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
s = input()
t = s.split('.') if '.' in s else [s, '']
(a, b) = (t[0], t[1])
b += '00'
neg = False
if a[0] == '-':
	neg = True
	a = a[1:]
r = []
for i in range(len(a), 0, -3):
	r.append(a[max(0, i - 3):i])
r.reverse()
res = ','.join(r) + '.' + b[0:2]
print(f'(${res})') if neg else print(f'${res}')


t = input()
(a, b) = (int(t[0] == '-'), t.find('.'))
if b < 0:
	b = len(t)
	t += '.'
c = (b - a) % 3
print('(' * a + '$' + t[a:a + c] + ',' * (b - a > 2 and c > 0) + ','.join((t[i:i + 3] for i in range(a + c, b, 3))) + (t[b:] + '00')[:3] + ')' * a)


s = input()
co = True
if s[0] == '-':
	co = False
	s = s[1:]
n = len(s)
ans = ''
k = 0
while k < n and s[k] != '.':
	k += 1
if k == n:
	i = n - 1
	count = 0
	while i >= 0:
		if count == 3:
			ans = ',' + ans
			count = 0
		ans = s[i] + ans
		count += 1
		i -= 1
	if co:
		print('$' + ans + '.00')
	else:
		print('($' + ans + '.00)')
else:
	pre = s[:k]
	post = s[k + 1:] + '00'
	i = k - 1
	count = 0
	while i >= 0:
		if count == 3:
			ans = ',' + ans
			count = 0
		ans = pre[i] + ans
		count += 1
		i -= 1
	if co:
		print('$' + ans + '.' + post[:2])
	else:
		print('($' + ans + '.' + post[:2] + ')')


a = input()
n = 0
b = '00'
if '-' in a:
	n = 1
	a = a[1:]
if '.' in a:
	(a, b) = a.split('.')
	if len(b) > 2:
		b = b[:2]
	if len(b) < 2:
		b += '0'
a = a[::-1]
r = ''
for i in range(0, len(a), 3):
	r += ',' + a[i:i + 3]
r = '$' + r[1:][::-1] + '.' + b
if n:
	r = '(' + r + ')'
print(r)


import re
import itertools
from collections import Counter

class Task:
	number = ''
	answer = ''

	def getData(self):
		self.number = input()

	def solve(self):
		matcher = re.match('[^\\d]*(\\d*)[^\\d]*(\\d*)', self.number)
		integerPart = matcher.group(1)
		fractionPart = matcher.group(2)
		newIntegerPart = '$' + re.sub('(\\d{3})(?=\\d)', '\\1,', integerPart[::-1])[::-1]
		newFractionPart = fractionPart[0:2] if len(fractionPart) >= 2 else fractionPart + '0' * (2 - len(fractionPart))
		self.answer = newIntegerPart + '.' + newFractionPart
		if self.number[0] == '-':
			self.answer = '(' + self.answer + ')'

	def printAnswer(self):
		print(self.answer)
task = Task()
task.getData()
task.solve()
task.printAnswer()


import math
num = input()
if '.' not in num:
	num += '.00'
(ip, dp) = num.split('.')
neg = False
if ip[0] == '-':
	neg = True
	ip = ip[1:]
if len(dp) > 2:
	dp = dp[:2]
while len(dp) < 2:
	dp += '0'
i = 0
while i < len(ip) and ip[i] == '0':
	i += 1
ip = ip[i:]
if len(ip) > 3:
	ip = ip[::-1]
	ip = ','.join((ip[3 * i:min(3 * i + 3, len(ip))] for i in range(math.ceil(len(ip) / 3))))
	ip = ip[::-1]
if len(ip) == 0:
	ip = '0'
	if int(num.split('.')[1]) == 0:
		neg = False
if neg:
	print('(', end='')
print('$' + ip + '.' + dp, end='')
if neg:
	print(')', end='')


s = input()
n = len(s)
if s[0] == '-':
	print('($', end='')
	flag = -1
	for i in range(1, n):
		if s[i] == '.':
			flag = i
			break
	if flag != -1:
		for i in range(1, flag):
			if i != 1 and (flag - i) % 3 == 0:
				print(',', end='')
			print(s[i], end='')
		if flag + 2 < n:
			print(s[flag], s[flag + 1], s[flag + 2], ')', sep='', end='')
		else:
			print(s[flag], s[flag + 1], '0)', sep='', end='')
	else:
		for i in range(1, n):
			if i != 1 and (n - i) % 3 == 0:
				print(',', end='')
			print(s[i], end='')
		print('.00)')
else:
	print('$', end='')
	flag = -1
	for i in range(n):
		if s[i] == '.':
			flag = i
			break
	if flag != -1:
		for i in range(flag):
			if i != 0 and (flag - i) % 3 == 0:
				print(',', end='')
			print(s[i], end='')
		if flag + 2 < n:
			print(s[flag], s[flag + 1], s[flag + 2], sep='', end='')
		else:
			print(s[flag], s[flag + 1], '0', sep='', end='')
	else:
		for i in range(n):
			if i != 0 and (n - i) % 3 == 0:
				print(',', end='')
			print(s[i], end='')
		print('.00')


from sys import stdin, stdout
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
s = is1()
neg = False
intef = True
inte = ''
deci = ''
for i in s:
	if i == '-':
		neg = True
	elif i == '.':
		intef = False
	elif intef:
		inte += i
	else:
		deci += i
inte = str(int(inte))[::-1]
num = ''
i = 0
while i < len(inte) - 3:
	num += inte[i:i + 3] + ','
	i += 3
num += inte[i:]
num = num[::-1]
if len(deci):
	deci = deci[:2] + '0' * (2 - len(deci))
else:
	deci = '00'
if neg:
	ans = f'(${num}.{deci})'
else:
	ans = f'${num}.{deci}'
print(ans)


number = input()
parts = number.split('.')
intPart = parts[0]
decimalPart = ['0', '0']
shouldAddParentheses = intPart[0] == '-'
if len(parts) == 2:
	for i in range(min(len(parts[1]), 2)):
		decimalPart[i] = parts[1][i]
tempIntPart = []
digitCount = 0
for i in range(len(intPart) - 1, -1, -1):
	if intPart[i] == '-':
		continue
	if digitCount == 3:
		tempIntPart.append(',')
		digitCount = 0
	tempIntPart.append(intPart[i])
	digitCount += 1
intPart = reversed(tempIntPart)
result = '$' + ''.join([str(x) for x in intPart]) + '.' + ''.join([str(x) for x in decimalPart])
if shouldAddParentheses:
	result = '(' + result + ')'
print(result)


s = input()
str = ''
b = 0
if s[0] == '-':
	b = 1
d = ''
t = len(s)
for i in range(len(s)):
	if s[i] == '.':
		t = i
		break
if t < len(s):
	if t < len(s) - 2:
		d += s[t + 1] + s[t + 2]
	else:
		d += s[t + 1] + '0'
else:
	d = '00'
for i in range(t - 1, -1, -1):
	if s[i] == '-':
		break
	str = s[i] + str
	if (t - i) % 3 == 0 and s[i - 1] != '-' and (i != 0):
		str = ',' + str
str = '$' + str + '.' + d
if b == 1:
	str = '(' + str + ')'
print(str)


n = input()
(b, c) = (0, 0)
if n[0] == '-':
	c = 1
n = list(n)
if c == 1:
	n.remove(n[0])
try:
	a = n.index('.')
except:
	b = 1
if b == 1:
	end = '.00'
	n.append(end)
elif a + 2 >= len(n):
	n.append('0')
else:
	n = n[:a + 3]
n = ''.join(n)
q = n[:-3]
lenq = len(q)
if c == 1:
	print('($', end='')
else:
	print('$', end='')
if lenq > 3:
	if lenq % 3 == 0:
		print(n[:3], end='')
		w = 3
	elif lenq % 3 == 1:
		print(n[:1], end='')
		w = 1
	elif lenq % 3 == 2:
		print(n[:2], end='')
		w = 2
	while w < lenq:
		print(',' + n[w:w + 3], end='')
		w += 3
	print(n[-3:], end='')
else:
	print(n, end='')
if c == 1:
	print(')')


s = input().split('.')
if len(s) == 1:
	s.append('')
s[1] = s[1][:2]
s[1] += '0' * (2 - len(s[1]))
isNegative = False
if s[0][0] == '-':
	isNegative = True
	s[0] = s[0][1:]
n = ''
for i in range(len(s[0])):
	n += s[0][-i - 1]
	if (i + 1) % 3 == 0:
		n += ','
if n[-1] == ',':
	n = n[:-1]
n = '$' + n[::-1]
if isNegative:
	print('(' + n + '.' + s[1] + ')')
else:
	print(n + '.' + s[1])


n = n0 = input()
z = n.find('.')
n = n + '.00' if z == -1 else n[:z + 3] + '0' * (3 - len(n) + z)
for i in range(n.find('.') - 3, -1, -3):
	if i > int(float(n0) < 0):
		n = n[:i] + ',' + n[i:]
print('$' + n if float(n0) >= 0 else '($' + n[n.find('-') + 1:] + ')')


(a, b) = (input(), '00')
if '.' in a:
	(a, b) = a.split('.')
	if len(b) >= 2:
		b = b[:2]
	else:
		b += '0'
flag = False
if a[0] == '-':
	(a, flag) = (a[1:], True)
(i, z) = (1, '')
for c in a[::-1]:
	z += c
	if i % 3 == 0 and i != len(a):
		z += ','
	i += 1
z = '$' + z[::-1] + '.' + b
if flag:
	z = '(' + z + ')'
print(z)


s = input().strip()
a = []
if s[0] == '-':
	p = '($'
	s = s[1:]
else:
	p = '$'
j = 0
t = '.'
n = len(s)
while j < n:
	if s[j] == '.':
		t = t + s[j + 1]
		if j + 2 < n:
			t = t + s[j + 2]
		else:
			t = t + '0'
		break
	else:
		j = j + 1
if t == '.':
	t = '.00'
u = 0
for k in range(j - 1, -1, -1):
	u = u + 1
	if u == 3:
		a.append(s[k])
		if k - 1 >= 0:
			a.append(',')
		u = 0
	else:
		a.append(s[k])
a = p + ''.join(a[::-1]) + t
if a[0] == '(':
	a = a + ')'
print(a)


from decimal import Decimal
money = input()
if '.' in money:
	(int_part, fract_part) = money.split('.')
	money = '.'.join((int_part, fract_part[:2]))
(money, neg) = (money.replace('-', ''), '-' in money)
s = '${:,.2f}'.format(Decimal(money))
print('(' + s + ')' if neg else s)


s = input()
dot = 0
if '.' in s:
	dot = s.index('.')
else:
	dot = len(s)
a = s[0:dot]
b = s[dot + 1:len(s)]
c = a
d = b
ans = ''
if a[0] == '-':
	ans += '('
ans += '$'
if len(d) >= 2:
	d = d[0:2]
elif len(d) == 1:
	d += '0'
elif len(d) == 0:
	d += '00'
c = c.replace('-', '')
cc = ''
ccc = ''
if len(c) > 3:
	c = list(c)
	c.reverse()
	j = 0
	for i in range(1, len(s) // 3 + 1):
		c.insert(3 * i + j, ',')
		j += 1
	c.reverse()
	cc = ''
	for i in c:
		cc += i
	else:
		ccc = cc
else:
	ccc = c
ans += ccc
ans += '.'
ans += d
if a[0] == '-':
	if ans[2] == ',':
		ans1 = list(ans)
		i = 2
		while i < len(ans1):
			if ans1[i] == ',':
				ans1.remove(',')
			else:
				break
		ans = ''
		for i in ans1:
			ans += i
	ans += ')'
elif ans[1] == ',':
	ans1 = list(ans)
	i = 1
	while i < len(ans1):
		if ans1[i] == ',':
			ans1.remove(',')
		else:
			break
	ans = ''
	for i in ans1:
		ans += i
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict
from math import ceil, floor, sqrt, log2, gcd, pi
from heapq import heappush, heappop
from bisect import bisect_left, bisect
import sys
abc = 'abcdefghijklmnopqrstuvwxyz'
ABC = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
s = input()
if '.' not in s:
	s += '.00'
(l, r) = s.split('.')
if len(r) < 2:
	r += '00'
r = r[:2]
minus = 0
if l[0] == '-':
	minus = 1
	l = l[1:]
ans = ''
c = 0
l = list(l)
while l:
	c += 1
	ans += l.pop()
	if c % 3 == 0:
		ans += ','
if ans[-1] == ',':
	ans = ans[:-1]
if minus == 0:
	print('$' + ans[::-1] + '.' + r)
else:
	print('($' + ans[::-1] + '.' + r + ')')


import sys
n = sys.stdin.readline().strip()

def formatN(n):
	formated = '$'
	if '-' in n:
		addSc = True
		formated = '(' + formated
		n = n[1:]
	else:
		addSc = False
	n = n.split('.')
	leftPart = n[0]
	pos = len(leftPart) % 3
	if pos == 0:
		pos = 3
	formated = formated + leftPart[0:pos]
	for i in range(pos, len(leftPart), 3):
		formated = formated + ',' + leftPart[i:i + 3]
	formated = formated + '.'
	if len(n) > 1:
		rightPart = n[1]
		formated = formated + rightPart[0:2]
		if len(rightPart) < 2:
			formated = formated + '0' * (2 - len(rightPart))
	else:
		formated = formated + '00'
	if addSc:
		formated = formated + ')'
	return formated
print(formatN(n))


s = input()
start = 1 if s[0] == '-' else 0
answer = ''
float_start = 0
try:
	float_start = s.index('.')
except:
	float_start = len(s)
if float_start == len(s):
	answer += '00.'
else:
	answer += s[float_start + 1:float_start + 3][::-1] + '.'
if float_start + 2 >= len(s):
	answer = '0' + answer[0] + '.'
current = 0
for i in range(float_start - 1, start - 1, -1):
	current += 1
	answer += s[i]
	if current == 3 and i != start:
		answer += ','
		current = 0
answer += '$'
if start == 1:
	print(f'({answer[::-1]})')
else:
	print(answer[::-1])


string = input()
answer = string
fraction = string.find('.')
if fraction != -1:
	answer = string[:fraction]
	fraction = string[fraction + 1:]
if string[0] == '-':
	print('($', end='')
	answer = answer[1:]
else:
	print('$', end='')
for i in range(0, answer.__len__() % 3):
	print(answer[i], end='')
	if answer.__len__() > 3 and i == answer.__len__() % 3 - 1:
		print(',', end='')
for i in range(answer.__len__() % 3, answer.__len__() - 2, 3):
	print(answer[i] + answer[i + 1] + answer[i + 2], end='')
	if i + 3 < answer.__len__() - 2:
		print(',', end='')
print('.', end='')
if fraction == -1:
	print('00', end='')
elif fraction.__len__() == 1:
	print(str(fraction) + '0', end='')
else:
	print(str(fraction[0]) + str(fraction[1]), end='')
if string[0] == '-':
	print(')', end='')


import textwrap
money = list(input())
if money[0] == '-':
	negative = True
	money = ''.join(money[1:])
else:
	negative = False
	money = ''.join(money)
money = list(money.split('.'))
if len(money) == 1:
	whole = money[0]
	partial = -1
else:
	whole = money[0]
	partial = list(money[1])
if partial != -1:
	if len(partial) < 2:
		while len(partial) < 2:
			partial.append('0')
			partial = ''.join(partial)
	elif len(str(partial)) > 2:
		partial = partial[:2]
		partial = ''.join(partial)
else:
	partial = '00'
whole = list(whole)[::-1]
commas = 0
if len(whole) > 3:
	commas = len(whole) // 3
wole = []
for i in range(len(whole)):
	if i % 3 == 0 and i != 0:
		wole.append(',')
	wole.append(whole[i])
whole = wole[::-1]
if whole[0] == ',':
	whole = whole[1:]
whole = list(map(str, whole))
whole = ''.join(whole)
final = '$' + whole + '.' + partial
if negative:
	final = list(final)
	final.insert(0, '(')
	final.append(')')
	final = ''.join(final)
print(final)


k = input()
list_after = []
flag = 0
if '.' in k:
	posn = k.find('.')
	flag = 1
if flag == 1:
	for i in range(posn + 1, len(k)):
		if len(list_after) == 2:
			break
		list_after.append(k[i])
if len(list_after) != 2:
	for i in range(2):
		if len(list_after) == 2:
			break
		list_after.append('0')
list_before = []
if flag == 1:
	c = list(k[:posn])
else:
	c = list(k)
ans = []
count = 1
for i in reversed(c):
	if i != '-':
		ans = [i] + ans
		if count % 3 == 0:
			ans = [','] + ans
		count += 1
ans.append('.')
ans = ['$'] + ans
for m in list_after:
	ans.append(m)
if ans[1] == ',' and ans[0] == '$':
	ans.pop(1)
if k[0] == '-':
	ans = ['('] + ans + [')']
print(''.join(ans))


A = input()
f = 0
if A[0] == '-':
	A = A[1:]
	f = 1
if '.' not in A:
	A += '.'
(p1, p2) = A.split('.')
fp1 = ''
for i in range(len(p1)):
	if i != 0 and (len(p1) - i) % 3 == 0:
		fp1 += ','
	fp1 += p1[i]
if len(p2) > 2:
	p2 = p2[:2]
p2 += '0' * (2 - len(p2))
if f == 0:
	print('$' + fp1 + '.' + p2)
else:
	print('($' + fp1 + '.' + p2 + ')')


s = input()
flag = 0
if s[0] == '-':
	flag = 1
	s = s.replace('-', '')
if '.' in s:
	a = s.index('.')
	n = s[a:]
	if len(n) < 3:
		n = n + '0'
	else:
		n = n[:3]
	r = a - 1
else:
	n = '.00'
	r = len(s) - 1
i = r
k = 0
d = ''
while i >= 0:
	k = k + 1
	d = d + s[i]
	i = i - 1
	if k % 3 == 0:
		d = d + ','
z = d[::-1] + n
if z[0] == ',':
	z = z[1:]
if flag == 1:
	print('($' + z + ')')
else:
	print('$' + z)


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
	while i >= 0:
		if len(num):
			num = ',' + num
		num = integer[i:i + 3] + 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)
main()


s = input()
neg = False
if s[0] == '-':
	(s, neg) = (s[1:], True)
p = s.find('.')
if p == -1:
	s += '.00'
elif len(s) - p == 2:
	s += '0'
elif len(s) - p > 3:
	s = s[:p + 3]
d = s.split('.')[0] + ','
while d.find(',') > 3:
	c = d.find(',') - 3
	d = d[:c] + ',' + d[c:]
d = d[:-1]
print('(' * neg + '$' + d + s[-3:] + ')' * neg)


n = input()
if '-' in n:
	n = n[1:]
	if '.' in n:
		(a, b) = n.split('.')
		if len(b) >= 2:
			b = b[:2]
		else:
			b += '000'
			b = b[:2]
		if len(a) <= 3:
			print('($' + a + '.' + b + ')')
		else:
			A = list(a)
			a = ''
			l = len(A)
			counter = 0
			for i in A:
				if (l - counter) % 3 == 0:
					a += ','
				a += i
				counter += 1
			if a[0] == ',':
				print('(' + '$' + a[1:] + '.' + b + ')')
			else:
				print('(' + '$' + a + '.' + b + ')')
	elif len(n) <= 3:
		print('(' + '$' + n + '.00)')
	else:
		A = list(n)
		a = ''
		l = len(A)
		counter = 0
		for i in A:
			if (l - counter) % 3 == 0:
				a += ','
			a += i
			counter += 1
		if a[0] == ',':
			print('(' + '$' + a[1:] + '.00' + ')')
		else:
			print('(' + '$' + a + '.00' + ')')
elif '.' in n:
	(a, b) = n.split('.')
	if len(b) >= 2:
		b = b[:2]
	else:
		b += '000'
		b = b[:2]
	if len(a) <= 3:
		print('$' + a + '.' + b)
	else:
		A = list(a)
		a = ''
		l = len(A)
		counter = 0
		for i in A:
			if (l - counter) % 3 == 0:
				a += ','
			a += i
			counter += 1
		if a[0] == ',':
			print('$' + a[1:] + '.' + b)
		else:
			print('$' + a + '.' + b)
elif len(n) <= 3:
	print('$' + n + '.00')
else:
	A = list(n)
	a = ''
	l = len(A)
	counter = 0
	for i in A:
		if (l - counter) % 3 == 0:
			a += ','
		a += i
		counter += 1
	if a[0] == ',':
		print('$' + a[1:] + '.00')
	else:
		print('$' + a + '.00')


s = input()
if '.' not in s:
	s += '.'
(integer, decimal) = s.split('.')
if len(decimal) > 2:
	decimal = decimal[0:2]
elif len(decimal) == 1:
	decimal = decimal + '0'
elif len(decimal) == 0:
	decimal = '00'
f = 0
if s[0] == '-':
	f = 1
	integer = integer[1:]
a = ''
for i in range(len(integer) - 1, -1, -3):
	if i == 0:
		a += integer[i]
	elif i == 1:
		a += integer[i] + integer[i - 1]
	elif i == 2:
		a += integer[i] + integer[i - 1] + integer[i - 2]
	else:
		a += integer[i] + integer[i - 1] + integer[i - 2] + ','
a = a[::-1]
if f == 0:
	ans = '$' + a + '.' + decimal
else:
	ans = '($' + a + '.' + decimal + ')'
print(ans)


def main():
	s = input()
	ans = ''
	if s[0] == '-':
		ans += ')'
	i = len(s) - 1
	x = -1
	while i >= 0:
		if s[i] == '.':
			x = i
			if i + 2 < len(s):
				ans += s[i + 2]
			else:
				ans += '0'
			if i + 1 < len(s):
				ans += s[i + 1]
			else:
				ans += '0'
			ans += '.'
			break
		i -= 1
	if x == -1:
		ans += '00.'
		x = len(s)
	i = x - 1
	c = 1
	while i >= 0:
		if s[i] == '-':
			break
		ans += s[i]
		if c % 3 == 0 and i > 0 and (s[i - 1] != '-'):
			ans += ','
		c += 1
		i -= 1
	ans += '$'
	if ans[0] == ')':
		ans += '('
	if s == '0':
		print('$0.00')
	else:
		print(ans[::-1])
main()


num = input()
m = False
if num[0] == '-':
	m = True
	num = num[1:]
i = num.find('.') - 1
if i < 0:
	i = len(num) - 1
d = num[i + 2:i + 4]
if len(d) == 1:
	d += '0'
elif len(d) == 0:
	d += '00'
ans = str()
c = 0
while i >= 0:
	if not c % 3:
		ans += ','
	ans += num[i]
	i -= 1
	c += 1
fin = ans[::-1][:-1] + '.' + d
if not fin:
	print('$' + fin)
elif m:
	print('($' + fin + ')')
else:
	print('$' + fin)


n = str(input())
(neg, b, son) = (0, '', '')
if n[0] == '-':
	neg = 1
	n = n[1:]
j = len(n)
if '.' in n:
	i = n.index('.')
	if j - 3 >= i:
		son += n[i:i + 3]
	else:
		son += n[i:]
		if len(son) == 2:
			son += '0'
	n = n[:i]
else:
	son += '.00'
j = len(n)
i = 1
c = ''
if j <= 3:
	b += n
else:
	while i != j + 1:
		if len(c) != 3:
			c = n[j - i] + c
			i += 1
		else:
			if b == '':
				b = c + b
			else:
				b = c + ',' + b
			c = ''
	if c != '':
		b = c + ',' + b
	k = len(b)
if neg == 1:
	b = '(' + '$' + b + son + ')'
else:
	b = '$' + b + son
print(b)


def pr(a, b):
	i = 0
	ans.append('$')
	n = len(a)
	while i < n:
		if (n - i) % 3 == 0 and i:
			ans.append(',')
		ans.append(a[i])
		i += 1
	ans.append('.')
	ans.append(b[:2] if len(b) != 1 else b[0] + '0')
p = input().split('.')
if len(p) == 1:
	p.append('00')
(dec, frac) = p
ans = []
if p[0][0] == '-':
	ans.append('(')
	pr(dec[1:], frac)
	ans.append(')')
else:
	pr(dec, frac)
print(''.join(ans))


import sys
from math import *

def solve():
	t = ''
	s = input()
	neg = 0
	if s[0] == '-':
		neg = 1
		s = s[1:]
	(i, j) = ('', '')
	if s.find('.') != -1:
		(i, j) = s.split('.')
		if len(j) < 2:
			j = j + '0'
		j = '.' + j
	else:
		i = s
		j = '.00'
	n = len(i)
	for k in range(n):
		if k % 3 == 2:
			t = t + i[n - k - 1] + ','
		else:
			t = t + i[n - k - 1]
	if t[-1] == ',':
		t = t[:-1]
	t = t[::-1]
	t = '$' + t + j[0] + j[1] + j[2]
	if neg:
		t = '(' + t + ')'
	print(t)
solve()


def readln():
	return tuple(map(int, input().split()))
d = input().split('.')
if len(d) == 1:
	d.append('00')
elif len(d[1]) == 0:
	d[1] = '00'
elif len(d[1]) == 1:
	d[1] += '0'
else:
	d[1] = d[1][:2]
out = '$%s.%s'
if d[0].startswith('-'):
	out = '($%s.%s)'
	d[0] = d[0][1:]
if len(d[0]) % 3:
	t = [d[0][:len(d[0]) % 3]]
else:
	t = []
for i in range(len(d[0]) % 3, len(d[0]), 3):
	t.append(d[0][i:i + 3])
d[0] = ','.join(t)
print(out % tuple(d))


import sys

def second_part(amt):
	if '.' not in amt:
		if amt[0] == '-':
			return '.00)'
		else:
			return '.00'
	second = ''
	second += amt.split('.')[1]
	if len(second) >= 2:
		second = list(second)[:2]
		second = ''.join(second)
	else:
		second += '0' * (2 - len(second))
	if amt[0] == '-':
		return '.' + second + ')'
	else:
		return '.' + second

def first_part(amt):
	first = ''
	if '.' in amt:
		first += amt.split('.')[0]
	else:
		first += amt
	if amt[0] == '-':
		till = 0
	else:
		till = -1
	s = ''
	comma = 0
	for i in range(len(first) - 1, till, -1):
		comma += 1
		s = first[i] + s
		if comma == 3:
			comma = 0
			s = ',' + s
	if s[0] == ',':
		s = s[1:]
	if amt[0] == '-':
		return '($' + s
	else:
		return '$' + s
amount = input()
financial_amount = first_part(amount) + second_part(amount)
print(financial_amount)


import sys
import bisect
import heapq
from math import *
from collections import defaultdict as dd
from collections import deque
from collections import Counter as c
from itertools import combinations as comb
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(var)

def l():
	return list(map(int, data().split()))

def sl():
	return list(map(str, data().split()))

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [[val for i in range(n)] for j in range(m)]
s = data()
decimal = -1
bracket = False
for i in range(len(s)):
	if s[i] == '.':
		decimal = i + 1
		break
if decimal == -1:
	(p1, p2) = (list(s), ['0', '0'])
else:
	(p1, p2) = (list(s[:decimal - 1]), list(s[decimal:]))
if len(p2) < 2:
	while len(p2) < 2:
		p2.append('0')
else:
	while len(p2) > 2:
		p2.pop()
if p1[0] == '-':
	p1.pop(0)
	bracket = True
comma = len(p1) // 3
mod = len(p1) % 3
first = [mod]
for i in range(comma - 1):
	first.append(first[len(first) - 1] + 3)
if bracket:
	out('(')
out('$')
for i in range(len(p1)):
	if i in first and i > 0:
		out(',')
	out(p1[i])
out('.')
for i in p2:
	out(i)
if bracket:
	out(')')


x = input()
i = 0
if x[i] == '-':
	negative = True
	i += 1
else:
	negative = False
if x.find('.') != -1:
	dollars = x[i:x.find('.')]
	i = x.find('.') + 1
else:
	dollars = x[i:]
	i = len(x) + 1
dollars = int(dollars)
if i < len(x):
	cents = x[i:i + 2]
else:
	cents = '00'
if len(cents) == 1:
	cents += '0'
if negative:
	print('(${0:,}.{1:s})'.format(dollars, cents))
else:
	print('${0:,}.{1:s}'.format(dollars, cents))


def main():
	from sys import stdin, stdout
	ip = stdin.readline().strip()
	inte = None
	flow = None
	for (i, j) in enumerate(ip):
		if j == '.':
			flow = ip[i:]
			inte = ip[:i]
			break
	if flow == None:
		flow = '.00'
		inte = ip
	elif len(flow) == 2:
		flow += '0'
	else:
		flow = flow[:3]
	ne = False
	if ip[0] == '-':
		ne = True
	if ne:
		inte = inte[1:]
	inte = inte[::-1]
	ans = ''
	for (i, j) in enumerate(inte):
		ans += j
		if i % 3 == 2:
			ans += ','
	ans = ans[::-1]
	if ans[0] == ',':
		ans = ans[1:]
	ans = '$' + ans
	if ne:
		stdout.write('({})'.format(ans + flow))
	else:
		stdout.write(ans + flow)
main()


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
s = [char for char in input()]
ans = []
if '.' not in s:
	s.reverse()
	i = 0
	l = len(s)
	if '-' in s:
		l -= 1
	while i < l:
		j = 0
		while j < 3 and i < l:
			ans.append(s[i])
			i += 1
			j += 1
		if i < l:
			ans.append(',')
	if '-' not in s:
		print('$' + ''.join(list(reversed(ans))) + '.00')
	else:
		print('($' + ''.join(list(reversed(ans))) + '.00)')
else:
	frac = s[s.index('.') + 1:]
	s = s[:s.index('.')]
	s.reverse()
	i = 0
	l = len(s)
	if '-' in s:
		l -= 1
	while i < l:
		j = 0
		while j < 3 and i < l:
			ans.append(s[i])
			i += 1
			j += 1
		if i < l:
			ans.append(',')
	res = ''.join(list(reversed(ans))) + '.'
	f = len(frac)
	if f == 1:
		res += frac[0] + '0'
	else:
		res += frac[0] + frac[1]
	if '-' not in s:
		print('$' + res)
	else:
		print('($' + res + ')')


n = input()
if n[0] == '-':
	ch = 1
	n = n[1:len(n)]
else:
	ch = 0
if '.' in n:
	(it, f) = n.split('.')
else:
	it = n
	f = '00'
i = ''
ss = len(it)
sss = ss % 3
i = i + it[0:sss]
i = i + ','
for nu in range((ss - sss) // 3):
	i = i + it[sss:sss + 3]
	sss = sss + 3
	i = i + ','
if i[-1] == ',':
	i = i[0:len(i) - 1]
if i[0] == ',':
	i = i[1:len(i)]
if ch == 1:
	print('(', end='')
	print('$', end='')
	print(i, end='')
	print('.', end='')
	if len(f) >= 2:
		print(f[0], end=f[1])
	else:
		for ii in f:
			print(ii, end='')
		for ii in range(2 - len(f)):
			print('0', end='')
	print(')')
else:
	print('$', end='')
	print(i, end='')
	print('.', end='')
	if len(f) >= 2:
		print(f[0], end=f[1])
	else:
		for ii in f:
			print(ii, end='')
		for ii in range(2 - len(f)):
			print('0', end='')


import sys, re
s = sys.stdin.readline().strip()
m = re.match('^(\\-?)(\\d+)(\\.?)(\\d*)$', s)
s = '$' + format(int(m.group(2)), ',') + '.' + (m.group(4) + '00')[0:2]
if m.group(1) == '-':
	s = '(' + s + ')'
print(s)


s = input()
start = 1 if s[0] == '-' else 0
answer = ''
float_start = len(s) if s.count('.') == 0 else s.index('.')
answer = ('0' + ('0' if float_start == len(s) else s[float_start + 1]) if float_start + 2 >= len(s) else s[float_start + 1:float_start + 3][::-1]) + '.'
current = 0
for i in range(float_start - 1, start - 1, -1):
	answer += s[i]
	current += 1
	if current == 3 and i != start:
		answer += ','
		current = 0
answer = (answer + '$')[::-1]
print(answer if start == 0 else '(' + answer + ')')


s = input()
if '.' in s:
	if s[0] == '-':
		i = 1
		a = '$'
		while s[i] != '.':
			a = a + s[i]
			i = i + 1
		c = 0
		x = len(a)
		d = ''
		for j in range(x - 1, 0, -1):
			c = c + 1
			d = a[j] + d
			if c == 3 and j != 1:
				d = ',' + d
				c = 0
		a = '$' + d
		a = a + '.'
		f = s[i + 1:i + 3]
		f = f + '00'
		a = a + f[0:2]
		print('(' + a + ')')
	else:
		i = 0
		a = '$'
		while s[i] != '.':
			a = a + s[i]
			i = i + 1
		c = 0
		x = len(a)
		d = ''
		for j in range(x - 1, 0, -1):
			c = c + 1
			d = a[j] + d
			if c == 3 and j != 1:
				d = ',' + d
				c = 0
		a = '$' + d
		a = a + '.'
		f = s[i + 1:i + 3]
		f = f + '00'
		a = a + f[0:2]
		print(a)
else:
	b = 0
	if s[0] == '-':
		b = 1
	a = '$' + s[b:]
	c = 0
	x = len(a)
	d = ''
	for i in range(x - 1, 0, -1):
		c = c + 1
		d = a[i] + d
		if c == 3 and i != 1:
			d = ',' + d
			c = 0
	a = '$' + d
	a = a + '.00'
	if b:
		print('(' + a + ')')
	else:
		print(a)


import sys
import string
from collections import Counter, defaultdict
from math import fsum, sqrt, gcd, ceil, factorial
from operator import *
from itertools import accumulate
inf = float('inf')
flush = lambda : sys.stdout.flush
comb = lambda x, y: factorial(x) // factorial(y) // factorial(x - y)
ip = lambda : input()
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())
s = ip()
if '.' not in s:
	s += '.00'
s += '00'
x = s.find('.')
s = s[:x + 3]
t = s[::-1][3:]
ans = ''
for i in range(0, len(t), 3):
	ans += t[i:i + 3] + ','
ans = ans[:-1][::-1]
ans = ans + s[x:]
if ans[0] == '-':
	ans = ans[1:]
	f = True
else:
	f = False
if ans[0] == ',':
	ans = ans[1:]
ans = '$' + ans
if f:
	ans = '(' + ans + ')'
print(ans)


s = input().rstrip()
if '.' in s:
	neg = 0
	if '-' in s:
		neg = 1
		s = [s[i] for i in range(1, len(s))]
		s = ''.join(s)
	b = s.split('.')
	if len(b[1]) == 1:
		postfix = b[1] + '0'
	else:
		postfix = b[1][0:2]
	prefix = ''
	y = 0
	for i in range(len(b[0]) - 1, -1, -1):
		if y == 2:
			prefix = ',' + b[0][i] + prefix
			y = 0
		else:
			y += 1
			prefix = b[0][i] + prefix
	prefix = [i for i in prefix]
	if prefix[0] == ',':
		prefix.pop(0)
	prefix = ''.join(prefix)
	ans = '$' + prefix + '.' + postfix
	if neg == 1:
		ans = '(' + ans + ')'
	print(ans)
else:
	neg = 0
	if '-' in s:
		neg = 1
		s = [s[i] for i in range(1, len(s))]
		s = ''.join(s)
	b = s.split('.')
	prefix = ''
	y = 0
	for i in range(len(b[0]) - 1, -1, -1):
		if y == 2:
			prefix = ',' + b[0][i] + prefix
			y = 0
		else:
			y += 1
			prefix = b[0][i] + prefix
	prefix = [i for i in prefix]
	if prefix[0] == ',':
		prefix.pop(0)
	prefix = ''.join(prefix)
	ans = '$' + prefix + '.' + '00'
	if neg == 1:
		ans = '(' + ans + ')'
	print(ans)


n = input()
if '.' in n:
	(s1, s2) = n.split('.')
else:
	s1 = n
	s2 = ''
if len(s2) > 2:
	s2 = s2[0:2]
else:
	s2 = s2 + '0' * (2 - len(s2))
if s1[0] == '-':
	s1 = s1[1:]
	s1 = s1[::-1]
	l = len(s1)
	c = 0
	s11 = ''
	if l % 3 != 0:
		ll = l // 3
	else:
		ll = l // 3 - 1
	k = 0
	for i in range(l + ll):
		if c < 3:
			s11 += s1[i - k]
			c += 1
		else:
			s11 += ','
			k += 1
			c = 0
	s1 = s11[::-1]
	s1 = '($' + s1
	s2 = s2 + ')'
else:
	s1 = s1[::-1]
	l = len(s1)
	c = 0
	s11 = ''
	if l % 3 != 0:
		ll = l // 3
	else:
		ll = l // 3 - 1
	k = 0
	for i in range(l + ll):
		if c < 3:
			s11 += s1[i - k]
			c += 1
		else:
			s11 += ','
			k += 1
			c = 0
	s1 = s11[::-1]
	s1 = '$' + s1
s = s1 + '.' + s2
print(s)


t = input()
(x, y, d) = ('', '', '.00')
if t[0] == '-':
	(x, y) = ('(', ')')
k = t.find('.')
if k > 0:
	d = (t[k:] + '00')[:3]
else:
	k = len(t)
j = len(x)
u = t[j:j + (k - j) % 3]
j += len(u)
if u and k > j:
	u += ','
print(x + '$' + u + ','.join((t[i:i + 3] for i in range(j, k, 3))) + d + y)


s = input('')
p = s.find('.')
flag = 0
if p == -1:
	p = len(s)
	s = s + '.00'
if len(s[p + 1:]) > 2:
	s = s[0:p + 3]
if len(s[p + 1:]) == 1:
	s = s[0:] + '0'
if len(s[p + 1:]) == 0:
	s = s[:] + '00'
if s[0:1] == '-':
	flag = 1
	s = s[1:]
	p = p - 1
if len(s[:p]) > 1:
	for i in s:
		if i == '0':
			s = s[s.index(i) + 1:]
			p = p - 1
		else:
			break
k = len(s[0:p + 1])
for i in s[p:0:-3]:
	if i == '.' or i == '-':
		k = k - 4
		continue
	s = s[0:k] + ',' + s[k:]
	k = k - 3
if flag == 1:
	s = '($' + s + ')'
else:
	s = '$' + s
print(s)


N = input()
fr = 0
a = 0
if '.' in N:
	fr = N[N.index('.') + 1:]
	if len(fr) > 2:
		fr = fr[:2]
	else:
		fr = fr + (2 - len(fr)) * '0'
	a = abs(int(N[:N.index('.')]))
else:
	a = abs(int(N))
	fr = '00'
sign = 1 if N[0] == '-' else 0
print(sign * '(' + '$' + '{:,}'.format(a) + '.' + fr + ')' * sign)


import math, re, sys, string, operator, functools, fractions, collections
sys.setrecursionlimit(10 ** 7)
RI = lambda x=' ': list(map(int, input().split(x)))
RS = lambda x=' ': input().rstrip().split(x)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
mod = int(1000000000.0 + 7)
eps = 1e-06
pi = math.acos(-1.0)
MAX = 100
s = RS()[0]
st = 0
if s[0] == '-':
	st = 1
s = s[st:].split('.')
(i, f) = ('0', '0')
i = s[0]
if len(s) > 1:
	f = s[1]
i = i[::-1]
f = f[::-1]
ans = '$' + ','.join([i[j:j + 3] for j in range(0, len(i), 3)])[::-1]
ans += '.' + f.zfill(2)[::-1][:2]
if st:
	ans = '(' + ans + ')'
print(ans)


def solve():
	a = input()
	x = a.split('.')
	neg = False
	if x[0][0] == '-':
		neg = True
		x[0] = x[0][1:]
	b = x[0]
	b = b[::-1]
	c = []
	res = '$'
	ct = 0
	i = 0
	j = 3
	while j < len(b):
		c.append(b[i:j])
		i += 3
		j += 3
	c.append(b[i:])
	for s in c[::-1]:
		res += s[::-1] + ','
	res = res[0:len(res) - 1]
	res += '.'
	if len(x) == 1:
		res += '00'
	elif len(x[1]) >= 2:
		res += x[1][0]
		res += x[1][1]
	elif len(x[1]) == 1:
		res += x[1][0]
		res += '0'
	if neg == True:
		print(f'({res})')
	else:
		print(res)
t = 1
while t > 0:
	solve()
	t -= 1


s = input()
l = []
a = '0'
b = '0'
x = 0
if s[0] == '-':
	x = 1
for i in range(x, len(s)):
	if s[i] == '.':
		if i + 1 < len(s):
			a = s[i + 1]
		if i + 2 < len(s):
			b = s[i + 2]
		break
	l.append(s[i])
ans = ''
for i in range(1, len(l) + 1):
	if i % 3 == 0 and i < len(l):
		ans = str(l[-i]) + ans
		ans = ',' + ans
	else:
		ans = str(l[-i]) + ans
ans += '.' + a + b
ans = '$' + ans
if s[0] == '-':
	ans = '(' + ans + ')'
print(ans)


num = input()
neg = False
if num[0] == '-':
	neg = True
	num = num[1:]
if '.' in num:
	(integer_part, mantise) = str(num).split('.')
else:
	integer_part = num
	mantise = ''
mantise = mantise[:2]
mantise = mantise + '0' * (2 - len(mantise))
integer_part = list(reversed(integer_part))
integer_part = [integer_part[i:i + 3] for i in range(0, len(integer_part), 3)]
integer_part = list(reversed([''.join(x[::-1]) for x in integer_part]))
num = '$' + ','.join(integer_part) + '.' + mantise
if neg:
	num = '(' + num + ')'
print(num)


__author__ = 'NIORLYS'

def financial_format_integer(number):
	if len(number) <= 3:
		return number
	r = []
	for i in range(1, len(number) + 1):
		r.append(number[-i])
		if i % 3 == 0 and i < len(number):
			r.append(',')
	r.reverse()
	return r
n = list(input())
if '.' in n:
	dot_index = n.index('.')
	if len(n) - 1 - dot_index == 1:
		n.append('0')
	elif len(n) - 1 - dot_index > 2:
		k = len(n) - 1 - dot_index - 2
		while k:
			n.pop()
			k -= 1
	decimal_part = ''.join(n[dot_index:len(n)])
	if n[0] != '-':
		integer_part = ''.join(financial_format_integer(n[0:dot_index]))
		print('$' + integer_part + decimal_part)
	else:
		integer_part = ''.join(financial_format_integer(n[1:dot_index]))
		print('(' + '$' + integer_part + decimal_part + ')')
else:
	decimal_part = '.00'
	if n[0] != '-':
		integer_part = ''.join(financial_format_integer(n))
		print('$' + integer_part + decimal_part)
	else:
		integer_part = ''.join(financial_format_integer(n[1:len(n)]))
		print('(' + '$' + integer_part + decimal_part + ')')


s = input()
if s.count('.') == 0:
	s += '.00'
else:
	a = s.find('.')
	if len(s) == a + 2:
		s += '0'
	else:
		s = s[:a + 3]
s = s[::-1]
t = s[:6]
for i in range(6, len(s)):
	if i % 3 == 0 and s[i] != '-':
		t += ',' + s[i]
	else:
		t += s[i]
s = t[::-1]
s = '$' + s
if s.count('-') > 0:
	s = '(' + s.replace('-', '') + ')'
print(s)


n = input()
if n[0] == '-':
	neg = True
	n = n.replace('-', '')
else:
	neg = False
end = ''
front = ''
if '.' in n:
	i = n.index('.')
	front = n[:i]
	l = len(n[i + 1:])
	if l == 1:
		end = n[i + 1] + '0'
	else:
		end = n[i + 1] + n[i + 2]
else:
	front = n
	end = '00'
front = front[::-1]
k = ''
for i in range(len(front)):
	if i and i % 3 == 0:
		k += ','
	k += front[i]
ans = '$' + k[::-1] + '.' + end
if neg:
	print('(' + ans + ')')
else:
	print(ans)


n = input()
str2 = ''
str1 = ''
ind = 0
flag = 0
if '.' in n:
	flag = 1
	ind = n.index('.')
	if len(n[ind + 1:len(n)]) == 1:
		str2 = str2 + '.' + n[ind + 1] + '0'
	elif len(n[ind + 1:len(n)]) > 2:
		str2 = str2 + '.' + n[ind + 1:ind + 3]
	else:
		str2 = str2 + '.' + n[ind + 1:len(n)]
if flag == 1:
	i = ind - 1
else:
	i = len(n) - 1
	str2 = '.00'
count = 3
flag = 0
if n[0] == '-':
	flag = 1
while i >= 0 and n[i] != '-':
	if count == 0:
		str1 = ',' + str1
		count = 3
	str1 = n[i] + str1
	i = i - 1
	count = count - 1
if flag == 1:
	print('($' + str1 + str2 + ')')
else:
	print('$' + str1 + str2)


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
A = input()
try:
	(intger, fraction) = A.split('.')
except:
	intger = A
	fraction = '00'
if len(fraction) >= 2:
	fraction = fraction[:2]
else:
	fraction = fraction + '0' * (2 - len(fraction))
if A[0] == '-':
	intger = intger[1:]
count = 0
str = ''
for i in range(len(intger) - 1, -1, -1):
	if count == 2 and i != 0:
		str = ',' + intger[i] + str
		count = 0
	else:
		str = intger[i] + str
		count += 1
ans = '$' + str + '.' + fraction
if A[0] == '-':
	ans = '(' + ans + ')'
print(ans)


string = input()
if '.' in string:
	if '-' in string:
		at1 = string.index('.')
		p1 = string[1:at1]
		p2 = string[at1 + 1:]
		num = ''
		k1 = len(p1) - 1
		chance = 0
		while k1 >= 0:
			if chance == 3:
				num = p1[k1] + ',' + num
				chance = 1
			else:
				num = p1[k1] + num
				chance += 1
			k1 -= 1
		if len(p2) >= 2:
			print('($' + num + '.' + p2[0] + p2[1] + ')')
		elif len(p2) == 1:
			print('($' + num + '.' + p2[0] + '0)')
		else:
			print('($' + num + '.' + '00)')
	else:
		at1 = string.index('.')
		p1 = string[:at1]
		p2 = string[at1 + 1:]
		num = ''
		k1 = len(p1) - 1
		chance = 0
		while k1 >= 0:
			if chance == 3:
				num = p1[k1] + ',' + num
				chance = 1
			else:
				num = p1[k1] + num
				chance += 1
			k1 -= 1
		if len(p2) >= 2:
			print('$' + num + '.' + p2[0] + p2[1] + '')
		elif len(p2) == 1:
			print('$' + num + '.' + p2[0] + '0')
		else:
			print('$' + num + '.' + '00')
elif '-' in string:
	p1 = string[1:]
	num = ''
	k1 = len(p1) - 1
	chance = 0
	while k1 >= 0:
		if chance == 3:
			num = p1[k1] + ',' + num
			chance = 1
		else:
			num = p1[k1] + num
			chance += 1
		k1 -= 1
	print('($' + num + '.' + '00)')
else:
	p1 = string
	num = ''
	k1 = len(p1) - 1
	chance = 0
	while k1 >= 0:
		if chance == 3:
			num = p1[k1] + ',' + num
			chance = 1
		else:
			num = p1[k1] + num
			chance += 1
		k1 -= 1
	print('$' + num + '.00')


n = input().split('.')
ip = ''
dp = ''
brac = False
if len(n) == 1:
	dp = '00'
else:
	dp = n[-1][:2]
if len(dp) == 1:
	dp += '0'
if n[0][0] == '-':
	brac = True
	n[0] = n[0][1:]
p = n[0][::-1]
for i in range(0, len(p), 3):
	ip += p[i:min(i + 3, len(p))] + ','
ip = '$' + ip[:-1][::-1]
ans = ip + '.' + dp
if brac == True:
	ans = '(' + ans + ')'
print(ans)


n = input().rstrip('\n')
temp = n.find('.')
if temp == -1:
	n = n + '.00'
else:
	n = n + '00'
final = ''
for i in range(0, len(n)):
	if n[i] == '-':
		continue
	elif n[i] == '.':
		final = final + '.' + n[i + 1] + n[i + 2]
		break
	else:
		final = final + n[i]
final = '${:,d}'.format(int(final[:-3])) + final[len(final) - 3:]
if n[0] == '-':
	final = '(' + final + ')'
print(final)


inp = input()
if '.' in inp:
	dec = inp[0:inp.index('.')]
	frac = (inp[inp.index('.') + 1:] + '00')[0:2]
else:
	dec = inp
	frac = '00'
if '-' in inp:
	dec = dec.replace('-', '')
dec_formatted = ''
for (i, c) in enumerate(dec[::-1]):
	dec_formatted = c + dec_formatted
	if i < len(dec) - 1 and (i + 1) % 3 == 0:
		dec_formatted = ',' + dec_formatted
if '-' in inp:
	print('($' + dec_formatted + '.' + frac + ')')
else:
	print('$' + dec_formatted + '.' + frac)


def main():
	s = input()
	neg = False
	if s[0] == '-':
		neg = True
		s = s[1:]
	pointPos = s.find('.')
	if pointPos == -1:
		pointPos = len(s)
	intPart = s[:pointPos]
	fraPart = s[pointPos + 1:pointPos + 3]
	for i in range(2 - len(fraPart)):
		fraPart += '0'
	a = []
	i = 0
	rev = intPart[::-1]
	while i < len(rev):
		a.append(rev[i:i + 3])
		i += 3
	ans = '$' + ','.join(a)[::-1] + '.' + fraPart
	if neg:
		ans = '(' + ans + ')'
	print(ans)
main()


s = input()
s = s + '.' if '.' not in s else s
(s1, s2) = s.split('.')
neg = 0
s2 = s2[:2]
if s1[0] == '-':
	s1 = s1[1:]
	neg = 1
if len(s2) == 0:
	s2 = '00'
elif len(s2) == 1:
	s2 += '0'
s1 = s1[::-1]
ret = ''
for i in range(len(s1)):
	if i and i % 3 == 0:
		ret += ','
	ret += s1[i]
ret = ret[::-1]
ans = ''
if neg:
	ans += '('
ans += '$' + ret + '.' + s2
if neg:
	ans += ')'
print(ans)


inp = list(input().split('.'))
ans = ['', '', '.', '00', '']
ans[0] = '$' if inp[0][0] != '-' else '($'
ans[4] = '' if inp[0][0] != '-' else ')'
ans[1] = inp[0] if inp[0][0] != '-' else inp[0][1:]
ans[1] = ''.join(reversed(ans[1]))
for (i, j) in zip(range(3, len(ans[1]), 3), range(len(ans[1]))):
	ans[1] = ans[1][:i + j] + ',' + ans[1][i + j:]
ans[1] = ''.join(reversed(ans[1]))
if len(inp) == 2:
	if len(inp[1]) < 2:
		ans[3] = inp[1][0] + '0'
	else:
		ans[3] = inp[1][:2]
print(''.join(ans))


s = str(input())
if s[0] == '*':
	print('0')
else:
	x = -1
	for i in range(0, len(s)):
		if s[i] == '.':
			x = i
			break
	if x == -1:
		if s[0] != '-':
			t = '$'
			for i in range(0, len(s)):
				t += s[i]
				if (len(s) - i - 1) % 3 == 0 and i != len(s) - 1:
					t += ','
			t += '.00'
		else:
			t = '($'
			for i in range(1, len(s)):
				t += s[i]
				if (len(s) - i - 1) % 3 == 0 and i != len(s) - 1:
					t += ','
			t += '.00)'
		print(t)
	else:
		u = ''
		if s[0] != '-':
			t = '$'
			for i in range(0, x):
				t += s[i]
				if (x - i - 1) % 3 == 0 and i != x - 1:
					t += ','
			for j in range(x, len(s)):
				u += s[j]
			if len(u) == 2:
				t = t + u + '0'
			elif len(u) == 3:
				t = t + u
			else:
				t = t + u[:3]
		else:
			t = '($'
			for i in range(1, x):
				t += s[i]
				if (x - i - 1) % 3 == 0 and i != x - 1:
					t += ','
			for j in range(x, len(s)):
				u += s[j]
			if len(u) == 2:
				t = t + u + '0)'
			elif len(u) == 3:
				t = t + u + ')'
			else:
				t = t + u[:3] + ')'
		print(t)


s = input()
b = False
if s[0] == '-':
	s = s[1:]
	b = True
if '.' in s:
	(i, j) = s.split('.')
	if len(j) > 2:
		j1 = j[:2]
	elif len(j) == 2:
		j1 = j
	elif len(j) == 1:
		j1 = j + '0'
	elif len(j) == 0:
		j1 = '00'
else:
	i = s
	j1 = '00'
li = []
for k in range(len(i)):
	li.append(s[k])
n = len(i) // 3
m = -3
p = 0
for i in range(n):
	li.insert(m - p, ',')
	m = m - 3
	p += 1
if li[0] == ',':
	del li[0]
l1 = ''.join(map(str, li))
if b:
	print('(' + '$' + l1 + '.' + j1 + ')')
else:
	print('$' + l1 + '.' + j1)


amt = input()
isNegative = amt[0] == '-'
amt = amt.replace('-', '')
hasDecimal = amt.find('.')
ans = '$'
if hasDecimal >= 0:
	temp = amt.split('.')
	firstp_r = temp[0][::-1]
	secondp = temp[1]
	firstp = ''
	for i in range(len(firstp_r)):
		if i % 3 == 0 and i != 0:
			firstp = firstp_r[i] + ',' + firstp
		else:
			firstp = firstp_r[i] + firstp
	ans += firstp + '.'
	if len(secondp) >= 2:
		ans += secondp[:2]
	else:
		ans += secondp + '0'
	if isNegative:
		ans = '(' + ans + ')'
	print(ans)
else:
	firstp_r = amt[::-1]
	firstp = ''
	for i in range(len(firstp_r)):
		if i % 3 == 0 and i != 0:
			firstp = firstp_r[i] + ',' + firstp
		else:
			firstp = firstp_r[i] + firstp
	ans += firstp + '.00'
	if isNegative:
		ans = '(' + ans + ')'
	print(ans)


import math
from collections import Counter
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
IN = lambda : input()
mod = 10 ** 9 + 7

def s(a):
	print(' '.join(list(map(str, a))))
n = IN()
f = 1
if n[0] == '-':
	f = 0
	n = n[1:]
x = n.split('.')
if len(x) == 2:
	if len(x[1]) == 1:
		s2 = x[1] + '0'
	else:
		s2 = x[1][:2]
else:
	s2 = '00'
l = len(x[0])
b = l % 3
s = x[0][:b]
for i in range(b, l, 3):
	if len(s) > 0:
		s += ','
	s += x[0][i:i + 3]
if f == 1:
	print('$' + s + '.' + s2)
else:
	print('($' + s + '.' + s2 + ')')


s = input()
s = s.split('.')
dec = '00'
if len(s) == 2:
	if len(s[1]) == 1:
		dec = s[1] + '0'
	else:
		dec = s[1][:2]
int_part = ''
brackets = False
if s[0][0] == '-':
	brackets = True
	int_part = s[0][1:]
else:
	int_part = s[0]
if len(int_part) > 3:
	int_part = int_part[::-1]
	arr = []
	for i in range(len(int_part) // 3):
		arr.append(int_part[3 * i:3 * i + 3])
	arr.append(int_part[3 * i + 3:])
	int_part = ','.join(arr)[::-1]
	if int_part[0] == ',':
		int_part = int_part[1:]
if brackets:
	print('($' + int_part + '.' + dec + ')')
else:
	print('$' + int_part + '.' + dec)


n = str(input())
negative = False
if n[0] == '-':
	negative = True
	n = n[1:]
parts = str(n).split('.')
int_output = ''
integer = parts[0]
temp = 0
for i in range(-1, -len(integer) - 1, -1):
	temp += 1
	int_output = integer[i] + int_output
	if temp == 3 and i > -len(integer):
		int_output = ',' + int_output
		temp = 0
str_output = ''
if len(parts) == 1:
	str_output = '00'
elif len(parts) == 2 and len(parts[1]) == 1:
	str_output = parts[1] + '0'
elif len(parts) == 2 and len(parts[1]) > 1:
	str_output = parts[1][:2]
output = '$' + int_output + '.' + str_output
if not negative:
	print(output)
else:
	print(f'({output})')


def mi():
	return map(int, input().split())
n = input()
neg = False
if n[0] == '-':
	neg = True
	n = n[1:]
if '.' not in n:
	n = n + '.00'
if len(n) - n.index('.') > 2:
	n = n[:n.index('.') + 3]
elif len(n) - n.index('.') == 2:
	n = n + '0'
i = int(n[:n.index('.')])
s = '$' + str(i) + '.' + n[n.index('.') + 1:]
if neg:
	s = '(' + s + ')'
s = list(s)[::-1]
i = s.index('.') + 4
while i < len(s):
	if s[i] != '(' and s[i] != '$':
		s.insert(i, ',')
	i += 4
print(''.join(s[::-1]))


s = input()
if s[0] == '-':
	res = '($'
	s = s[1:]
	c = s.count('.')
	frac = ''
	if c == 1:
		k = s.index('.') + 1
		frac = '.'
		if len(s) - k == 1:
			frac += s[k] + '0'
		elif len(s) - k >= 2:
			frac += s[k:k + 2]
		n = 0
		if k // 3 == k / 3:
			n = k // 3 - 1
		else:
			n = k // 3
		l = []
		c = 0
		for i in range(k - 2, -1, -1):
			if c == 3 and n >= 0:
				l.append(',')
				l.append(s[i])
				c = 1
				n -= 1
			else:
				l.append(s[i])
				c += 1
		res += ''.join(l[::-1]) + frac + ')'
		print(res)
	else:
		frac = '.00'
		n = 0
		k = len(s)
		if k // 3 == k / 3:
			n = k // 3 - 1
		else:
			n = k // 3
		l = []
		c = 0
		for i in range(k - 1, -1, -1):
			if c == 3 and n >= 0:
				l.append(',')
				l.append(s[i])
				c = 1
				n -= 1
			else:
				l.append(s[i])
				c += 1
		res += ''.join(l[::-1]) + frac + ')'
		print(res)
else:
	res = '$'
	c = s.count('.')
	frac = ''
	if c == 1:
		k = s.index('.') + 1
		frac = '.'
		if len(s) - k == 1:
			frac += s[k] + '0'
		elif len(s) - k >= 2:
			frac += s[k:k + 2]
		n = 0
		if k // 3 == k / 3:
			n = k // 3 - 1
		else:
			n = k // 3
		l = []
		c = 0
		for i in range(k - 2, -1, -1):
			if c == 3 and n >= 0:
				l.append(',')
				l.append(s[i])
				c = 1
				n -= 1
			else:
				l.append(s[i])
				c += 1
		res += ''.join(l[::-1]) + frac
		print(res)
	else:
		frac = '.00'
		n = 0
		k = len(s)
		if k // 3 == k / 3:
			n = k // 3 - 1
		else:
			n = k // 3
		l = []
		c = 0
		for i in range(k - 1, -1, -1):
			if c == 3 and n >= 0:
				l.append(',')
				l.append(s[i])
				c = 1
				n -= 1
			else:
				l.append(s[i])
				c += 1
		res += ''.join(l[::-1]) + frac
		print(res)


s1 = input()
ans = 0
if s1[0] == '-':
	ans = 1
	s1 = s1[1:]
if '.' in s1:
	(s1, s2) = s1.split('.')
	s2 = s2[:2]
else:
	s2 = '00'
if len(s2) == 1:
	s2 = s2 + '0'
s = s1[:len(s1) % 3]
for i in range(len(s1) % 3, len(s1), 3):
	if len(s) > 0:
		s += ','
	s += s1[i:i + 3]
if ans == 1:
	print('($' + s + '.' + s2 + ')')
else:
	print('$' + s + '.' + s2)


num = input()
flag = 0
if num[0] == '-':
	flag = 1
	num = num[1:]
if '.' in num:
	(num, den) = num.split('.')
	den = den[:2]
else:
	den = '00'
if len(den) == 1:
	den = den + '0'
num = num[::-1] + '$'
i = 3
while i < len(num) - 1:
	num = num[0:i] + ',' + num[i:len(num)]
	i += 4
num = num[::-1]
no = num + '.' + den
if flag == 1:
	no = '(' + no + ')'
print(no)