#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  while (cin >> s) {
    string integer;
    string decimal;
    bool isnegative = false;
    bool isdecimal = false;
    int pos = 0;
    if (s[0] == '-') {
      isnegative = true;
      pos++;
    }
    for (; pos < s.size(); pos++) {
      if (s[pos] == '.') {
        isdecimal = true;
      } else if (!isdecimal) {
        integer += s[pos];
      } else {
        decimal += s[pos];
      }
    }
    reverse(integer.begin(), integer.end());
    string integerWithComma;
    for (int i = 0; i < integer.size(); i++) {
      integerWithComma += integer[i];
      if (i != integer.size() - 1 && i % 3 == 2) {
        integerWithComma += ',';
      }
    }
    reverse(integerWithComma.begin(), integerWithComma.end());
    string decimalProcess;
    if (decimal.size() == 0) {
      decimalProcess = ".00";
    } else if (decimal.size() == 1) {
      decimalProcess = "." + decimal + "0";
    } else {
      decimalProcess = "." + decimal.substr(0, 2);
    }
    if (isnegative) {
      cout << "(";
    }
    cout << "$";
    cout << integerWithComma;
    cout << decimalProcess;
    if (isnegative) {
      cout << ")";
    }
    cout << endl;
  }
  return 0;
}
