#include <bits/stdc++.h>
using namespace std;
string A;
list<char> q;
int main() {
  int i;
  cin >> A;
  int p = A.find('.');
  if (p == string::npos)
    q.push_back('.'), q.push_back('0'), q.push_back('0'), p = A.size();
  else {
    q.push_back('.'), q.push_back(A[p + 1]);
    if (p + 2 < A.size())
      q.push_back(A[p + 2]);
    else
      q.push_back('0');
  }
  int c = p - 3;
  for (i = p - 1; i >= 0 && A[i] != '-'; i--) {
    q.push_front(A[i]);
    if (i == c && A[i] != '-') q.push_front(','), c -= 3;
  }
  if (*q.begin() == ',') q.erase(q.begin());
  q.push_front('$');
  if (A[0] == '-') q.push_front('('), q.push_back(')');
  for (list<char>::iterator it = q.begin(); it != q.end(); it++)
    printf("%c", *it);
  printf("\n");
  return 0;
}
