#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, c;
  bool flag = true;
  cin >> s;
  int pos = s.find('.');
  int cntF = 0, cntB = 0;
  if (pos == -1) {
    pos = s.size();
    flag = false;
  }
  if (flag) {
    for (int i = 0; s[i] != '.'; i++) {
      c += s[i];
    }
  } else {
    c = s;
  }
  for (int i = pos - 1; i >= 0; i--) {
    if (s[i] != '-') {
      cntF++;
    } else
      break;
    if (!(cntF % 3)) {
      c.insert(i, ",");
    }
  }
  if (!flag) {
    c += ".00";
  } else {
    for (int i = pos; i < s.size(); i++) {
      ++cntB;
      c += s[i];
      if (cntB == 3) break;
    }
    for (int i = 0; i < 3 - cntB; i++) {
      c += '0';
    }
  }
  if (c[0] == ',') {
    c.erase(0, 1);
  } else if (c[1] == ',' && c[0] == '-') {
    c.erase(1, 1);
  }
  if (c[0] == '-') {
    c[0] = '(';
    c.insert(1, "$");
    c.insert(c.size(), ")");
  } else {
    c.insert(0, "$");
  }
  cout << c << endl;
  return 0;
}
