#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const long long INF = (long long)1e18;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int N = 100100;
string second;
bool ok;
int main() {
  cin >> second;
  string t, S;
  int cnt = 0, ix = -1;
  if (second[0] == '-') ok = 1;
  bool was = 0;
  for (int i = ok; i < (int)second.size(); ++i) {
    if (second[i] == '.') {
      was = 1;
    }
    if (was) {
      t += second[i];
      cnt++;
      if (cnt == 3) break;
    } else {
      S += second[i];
    }
  }
  while (cnt < 3 && was) {
    cnt++;
    t += "0";
  }
  if (!was) {
    t = ".00";
  }
  reverse(S.begin(), S.end());
  second = "";
  for (int i = 0; i < (int)S.size(); ++i) {
    if (i && i % 3 == 0) {
      second += ",";
    }
    second += S[i];
  }
  reverse(second.begin(), second.end());
  second += t;
  if (ok)
    t = "($";
  else
    t = "$";
  t += second;
  if (ok) t += ")";
  cout << t << endl;
  return 0;
}
