#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  string res = "";
  if (s.find('.') == string::npos) {
    s += ".";
  }
  int d = s.find('.');
  int i = d - 1;
  int c = 0;
  while (i >= 0) {
    if (s[i] != '-') res = s[i] + res;
    c++;
    if (c == 3 && i > 0) {
      if (i - 1 >= 0 && s[i - 1] != '-') res = "," + res;
      c = 0;
    }
    i--;
  }
  res += ".";
  int dc = s.length() - 1 - d;
  if (dc == 0) {
    res += "00";
  } else if (dc == 1) {
    res += s[d + 1];
    res += "0";
  } else if (dc >= 2) {
    res += s[d + 1];
    res += s[d + 2];
  }
  res = "$" + res;
  if (s[0] == '-') res = "(" + res + ")";
  cout << res << endl;
}
