#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 1 + 10, INF = 1e9 + 10;
int main() {
  ios::sync_with_stdio(false);
  string s, tmp, ing, frac;
  bool minus = false;
  cin >> s;
  int i = 0;
  if (s[0] == '-') {
    i = 1;
    minus = true;
  }
  for (; i < ((int)s.size()); i++) {
    if (s[i] == '.') break;
    tmp.push_back(s[i]);
  }
  reverse(tmp.begin(), tmp.end());
  for (int j = 0; j < ((int)tmp.size()); j++) {
    ing.push_back(tmp[j]);
    if (j % 3 == 2 && j < ((int)tmp.size()) - 1) ing.push_back(',');
  }
  reverse(ing.begin(), ing.end());
  for (; i < ((int)s.size()); i++) {
    if (((int)frac.size()) == 3) break;
    frac.push_back(s[i]);
  }
  if (!((int)frac.size())) frac.push_back('.');
  while (true) {
    if (((int)frac.size()) == 3) break;
    frac.push_back('0');
  }
  string ans;
  if (minus) ans.push_back('(');
  ans.push_back('$');
  ans.append(ing);
  ans.append(frac);
  if (minus) ans.push_back(')');
  cout << ans << endl;
  return 0;
}
