#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  if (s[s.length() - 2] == '.') s += '0';
  s += ".000";
  string l = "";
  l += s[0];
  l += s[1];
  l += s[2];
  for (unsigned i = 3; i < s.length() && s[i - 3] != '.'; i++) l += s[i];
  s = l;
  l = "";
  bool b = false;
  if (s[0] == '-') {
    b = true;
    s.erase(0, 1);
  }
  if (s.length() % 3 != 0) {
    for (unsigned i = 0; i < 3 - s.length() % 3; i++) l += '*';
    l += s;
    s = l;
  }
  l = "";
  for (unsigned i = 1; i <= s.length(); i++) {
    if ((i - 1) % 3 == 0 && s[i - 1] != '.' && i != 1) {
      l += ',';
      l += s[i - 1];
    } else
      l += s[i - 1];
  }
  s = '$';
  s += l;
  l = "";
  for (unsigned i = 0; i < s.length(); i++) {
    if (s[i] != '*') l += s[i];
  }
  if (b)
    cout << '(' << l << ')' << endl;
  else
    cout << l << endl;
  return 0;
}
