#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.find(".") != string::npos) {
    s += "00";
  } else
    s += ".00";
  int dec = s.find(".");
  string res = "";
  int t;
  int i = 0;
  if (s[0] == '-') {
    res += "($";
    i = 1;
    t = (dec - 1) % 3;
  } else {
    res += "$";
    t = dec % 3;
  }
  if (t == 0) t += 3;
  for (int j = 1; i < dec; i++, j++) {
    if (j == t && j < dec - 1) {
      res += to_string(s[i] - '0') + ",";
      t += 3;
    } else
      res += to_string(s[i] - '0');
  }
  if (s[0] == '-')
    res += s.substr(dec, 3) + ")";
  else
    res += s.substr(dec, 3);
  cout << res;
}
