#include <bits/stdc++.h>
using namespace std;
int main() {
  string in;
  cin >> in;
  int n = in.size();
  bool neg = false;
  size_t found = in.find('.');
  int dec;
  if (found != string ::npos)
    dec = (int)found;
  else
    dec = n;
  int comma = dec % 3;
  int i;
  if (in[0] == '-') {
    neg = true;
    cout << "($";
  } else {
    cout << "$";
    i = 0;
  }
  if (comma == 0 && !neg) comma += 3;
  if ((comma == 1 || comma == 0) && neg) comma += 3;
  for (i = 0; i < n; i++) {
    if (i == dec)
      break;
    else if (i == comma) {
      cout << ",";
      comma = comma + 3;
    }
    if (in[i] == '-') {
      continue;
    } else {
      cout << in[i];
    }
  }
  cout << ".";
  string s = "";
  while (s.size() != 2) {
    i++;
    if (i < n) {
      s = s + in[i];
    } else {
      s = s + "0";
    }
  }
  cout << s;
  if (neg == true) {
    cout << ")";
  }
  cout << endl;
  return 0;
}
