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