#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string Number, integer = "", fraction = "";
  cin >> Number;
  int dpos = -1;
  for (int i = Number.length() - 1; i >= 0; i--) {
    if (Number[i] == '.') {
      dpos = i;
      fraction += Number[dpos + 1];
      if (Number.length() - i >= 3) {
        fraction += Number[dpos + 2];
      } else
        fraction += '0';
      break;
    }
  }
  if (dpos == -1) {
    fraction += '0';
    fraction += '0';
    dpos = Number.length();
  }
  bool minus = false;
  int cnt = 0;
  for (int i = dpos - 1; i >= 0; i--) {
    if (Number[i] != '-') {
      integer += Number[i];
      cnt++;
    } else
      minus = true;
    if (cnt == 3 && i != 0 && (i > 0 && Number[i - 1] != '-')) {
      integer += ',';
      cnt = 0;
    }
  }
  reverse(integer.begin(), integer.end());
  if (minus) cout << "(";
  cout << "$";
  cout << integer << "." << fraction;
  if (minus) cout << ")";
  return 0;
}
