#include <bits/stdc++.h>
using namespace std;
string my(string s1) {
  bool n = (s1[0] == '-');
  if (n) {
    s1 = s1.substr(1);
  }
  int temp = 0;
  while ((s1[temp] != '.')) {
    temp++;
    if (temp == s1.length()) {
      s1 = s1 + ".";
      break;
    }
  }
  string test = s1.substr(temp + 1, 2);
  int j = temp;
  stack<string> akshay;
  while (j >= 3) {
    string p1 = s1.substr(j - 3, 3);
    akshay.push(p1);
    j -= 3;
  }
  string answer = "$";
  bool one = true;
  if (j > 0) {
    one = false;
    answer += s1.substr(0, j);
  }
  while (!akshay.empty()) {
    if (one) {
      one = false;
    } else {
      answer += ",";
    }
    answer += akshay.top();
    akshay.pop();
  }
  answer += string(".") + test;
  if (test.length() < 2) {
    answer += string(2 - test.length(), '0');
  }
  if (n) {
    answer = string("(") + answer + string(")");
  }
  return answer;
}
int main() {
  string s;
  cin >> s;
  s = my(s);
  cout << s << endl;
  return 0;
}
