#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int d = 0;
  bool bra = false;
  if (s[0] == '-') {
    bra = true;
    d = 1;
  }
  string n = "";
  string dec = "";
  for (int i = d; i < s.size(); i++) {
    if (s[i] != '.') {
      n += s[i];
    } else {
      for (i; i < s.size(); i++) {
        dec += s[i];
      }
      break;
    }
  }
  if (dec.size() > 3) {
    string tmp = "";
    for (int i = 0, _n = (3); i < _n; i++) {
      tmp += dec[i];
    }
    dec = tmp;
  } else if (dec == "") {
    dec = ".00";
  } else if (dec.size() == 2) {
    dec += "0";
  }
  reverse((n).begin(), (n).end());
  string ret = "";
  for (int i = 0, _n = (n.size()); i < _n; i++) {
    if (i % 3 == 0 && i != 0) {
      ret += ",";
    }
    ret += n[i];
  }
  reverse((ret).begin(), (ret).end());
  ret += dec;
  ret = "$" + ret;
  if (bra) ret = "(" + ret + ")";
  cout << ret;
  return 0;
}
