#include <bits/stdc++.h>
using namespace std;
string getPart(string, int);
string makeInt(string);
string makeReal(string);
int main() {
  string s, ans = "";
  bool br;
  getline(cin, s);
  string part1 = getPart(s, 1), part2 = getPart(s, 2);
  if (part1[0] == '-')
    br = true;
  else
    br = false;
  if (br) part1 = part1.substr(1);
  ans = "$" + makeInt(part1) + "." + makeReal(part2);
  if (br) ans = "(" + ans + ")";
  printf("%s", ans.c_str());
  return 0;
}
string makeReal(string s) {
  if (s.length() < 2) return s + "0";
  return s.substr(0, 2);
}
string makeInt(string p) {
  int len = p.length();
  string res = "";
  if (len <= 3)
    return p;
  else {
    if (len % 3 == 0) {
      for (int i = len - 1, j = 1; i > -1; i--, j++) {
        if (j % 3 == 0 && j != len)
          res = "," + p.substr(i, 1) + res;
        else
          res = p[i] + res;
      }
    } else {
      for (int i = p.length() - 1, j = 1; i > -1; i--, j++) {
        if (j % 3 == 0)
          res = "," + p.substr(i, 1) + res;
        else
          res = p.substr(i, 1) + res;
      }
    }
    return res;
  }
}
string getPart(string str, int p) {
  string res = "";
  bool dot = false;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == '.') dot = true;
    if (str[i] != '.')
      res += str[i];
    else if (p == 1)
      return res;
    else
      res = "";
  }
  if (!dot && p == 2) return "00";
  return res;
}
