#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, i, j, floatf = 0, len = 0, minus = 0, d = 1;
  string s, ss;
  cin >> s;
  if (s[0] == '-') minus = 1;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == '.') {
      floatf = 1;
      break;
    }
    len++;
  }
  ss = '.';
  int c = 0, com = 0;
  if (floatf == 1) {
    for (i = len + 1; i < s.length(); i++) {
      ss += s[i];
      c++;
      if (c == 2) {
        com = 1;
        break;
      }
    }
  }
  if (com == 0 || floatf == 0) {
    for (i = c; i < 2; i++) ss += '0';
  }
  if (floatf == 0) len = s.length();
  c = 0;
  for (i = len - 1; i >= 0; i--) {
    c++;
    if (s[i] != '-') ss = s[i] + ss;
    if (c == 3) {
      if ((minus == 1 && i > 1) || (minus == 0 && i > 0)) {
        ss = ',' + ss;
        c = 0;
      }
    }
  }
  if (minus == 1) ss += ')';
  ss = '$' + ss;
  if (minus == 1) ss = '(' + ss;
  cout << ss << endl;
  return 0;
}
