#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, num;
  cin >> s;
  int i, intp = 0, count = 0;
  int minus = -1, period = -1;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == '-') minus++;
    if (s[i] == '.') period = i;
  }
  if (!minus) num.push_back('(');
  num.push_back('$');
  if (period != -1) {
    if (minus == 0) {
      intp = period - 1;
      for (i = 1; i < period; i++) {
        num.push_back(s[i]);
        count++;
        if (i == period - 1) break;
        if (count == intp % 3 || (count - intp % 3) % 3 == 0)
          num.push_back(',');
      }
    } else {
      intp = period;
      for (i = 0; i < period; i++) {
        num.push_back(s[i]);
        count++;
        if (i == period - 1) break;
        if (count == intp % 3 || (count - intp % 3) % 3 == 0)
          num.push_back(',');
      }
    }
    num.push_back('.');
    if (period + 1 < s.length())
      num.push_back(s[period + 1]);
    else
      num.push_back('0');
    if (period + 2 < s.length())
      num.push_back(s[period + 2]);
    else
      num.push_back('0');
  } else {
    if (minus == 0) {
      for (i = 1; i < s.length(); i++) {
        intp = s.length() - 1;
        num.push_back(s[i]);
        count++;
        if (i == intp) break;
        if (count == intp % 3 || (count - intp % 3) % 3 == 0)
          num.push_back(',');
      }
    } else
      for (i = 0; i < s.length(); i++) {
        intp = s.length();
        num.push_back(s[i]);
        count++;
        if (i == intp - 1) break;
        if (count == intp % 3 || (count - intp % 3) % 3 == 0)
          num.push_back(',');
      }
    num.push_back('.');
    num.push_back('0');
    num.push_back('0');
  }
  if (minus == 0) num.push_back(')');
  cout << num;
  return 0;
}
