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