#include <bits/stdc++.h>
using namespace std;
int main() {
  int flag = 0, i, k;
  string str, s;
  cin >> str;
  if (str.at(0) == '-') {
    flag = 1;
    str.erase(0, 1);
  }
  if (flag == 1) cout << "(";
  cout << "$";
  if ((int)str.find('.') != -1)
    s = str.substr(0, str.find('.'));
  else
    s = str.substr(0);
  k = s.length() % 3;
  for (i = 0; i < s.length(); i++) {
    if (i % 3 == k && i != 0) cout << ",";
    cout << str.at(i);
  }
  cout << ".";
  if (str.find('.') == -1) {
    cout << "00";
    goto jump;
  }
  s = str.substr(str.find('.') + 1);
  s += "0";
  s = s.substr(0, 2);
  cout << s;
jump:
  if (flag == 1) cout << ")";
  cout << endl;
  return 0;
}
