#include <bits/stdc++.h>
using namespace std;
string t, s;
bool z;
int main() {
  cin >> t;
  if (t[0] == '0') {
    cout << "$0.";
    if (t.size() >= 3)
      cout << t[2];
    else
      cout << "0";
    if (t.size() >= 4)
      cout << t[3];
    else
      cout << "0";
    cout << endl, exit(0);
  }
  if (t[0] == '-') s += ')', z = 1;
  s += "00.";
  for (int i = t.size() - 1; i >= 0 + z; i--) {
    if (t[i] == '.') {
      if (z == 1)
        s = ")";
      else
        s = "";
      if (i + 2 < t.size())
        s += t[i + 2];
      else
        s += '0';
      if (i + 1 < t.size())
        s += t[i + 1];
      else
        s += '0';
    }
    s += t[i];
  }
  s += '$', s += (z == 1 ? "(" : "");
  s = string(s.rbegin(), s.rend());
  string cur = "";
  int k = 0;
  for (int i = s.size() - 1; i >= s.size() - 3 - z; i--) cur += s[i];
  for (int i = s.size() - 4 - z; i >= 0; i--) {
    if (s[i] == '$') break;
    if (k == 3) cur += ',', k = 0;
    cur += s[i], k++;
  }
  cur += "$", cur += (z == 1 ? "(" : "");
  cout << string(cur.rbegin(), cur.rend()) << endl;
}
