#include <bits/stdc++.h>
using namespace std;
string val, integ, mant, res;
int m, point = -1, k, t = 0;
int main() {
  cin >> val;
  if (val[0] == '-') {
    m = 1;
    val = val.substr(1, val.size() - 1);
  }
  for (int i = 0; i < val.size(); i++) {
    if (val[i] == '.') point = i;
  }
  if (point == -1) {
    integ = val;
    mant = "00";
  } else {
    integ = val.substr(0, point);
    mant = val.substr(point + 1, val.size() - point - 1);
  }
  if (mant.size() < 2) mant = mant + "0";
  mant = mant.substr(0, 2);
  k = integ.size() % 3;
  for (int i = 0; i < integ.size(); i++) {
    res = res + integ.substr(i, 1);
    if (i % 3 == (k + 3 - 1) % 3 and i != integ.size() - 1) res = res + ",";
  }
  res = "$" + res + "." + mant;
  if (m) res = "(" + res + ")";
  cout << res;
  return 0;
}
