#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool zero = (count(s.begin(), s.end(), '0') + count(s.begin(), s.end(), '.') +
                   count(s.begin(), s.end(), '-') ==
               s.size());
  if (s.find(".") == string::npos)
    s += ".00";
  else {
    int ind = s.find(".");
    while (s.size() - 1 - ind < 2) s += "0";
    if (s.size() - 1 - ind > 2) s = s.substr(0, ind + 3);
  }
  bool minus = false;
  if (s[0] == '-' && !zero) minus = true;
  if (s[0] == '-') s = s.substr(1, s.size() - 1);
  if (minus) cout << '(';
  cout << '$';
  int ind = s.size() - 3;
  for (int i = 0; i < ind; ++i) {
    cout << s[i];
    if (i % 3 == (ind - 1) % 3 && i != ind - 1) cout << ',';
  }
  cout << '.' << s[ind + 1] << s[ind + 2];
  if (minus) cout << ')';
  cout << '\n';
  return 0;
}
