#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, ans;
  int cnt, i, v;
  bool t = false;
  cin >> s;
  int n = s.size();
  if (s[0] == '-') {
    if (s[1] == '0') {
      cout << "($0.00)";
      return 0;
    }
  } else {
    if (s[0] == 0) {
      cout << "$0.00";
      return 0;
    }
  }
  if (s[0] == '-') {
    t = true;
    ans.push_back('(');
  }
  ans.push_back('$');
  i = 0;
  if (t == true) i = 1;
  while (s[i] != '.' && i < n) {
    cnt++;
    i++;
  }
  v = cnt % 3;
  bool f;
  if (v == 0)
    f = true;
  else
    f = false;
  i = 0;
  if (t == true) i = 1;
  while (i < n && s[i] != '.') {
    if (v == 0) {
      if (f == false) ans.push_back(',');
      v = 3;
      f = false;
    } else {
      v--;
      ans.push_back(s[i++]);
    }
  }
  if (i == n) {
    ans.push_back('.');
    ans.push_back('0');
    ans.push_back('0');
  } else if (i == n - 2) {
    ans.push_back(s[i++]);
    ans.push_back(s[i++]);
    ans.push_back('0');
  } else if (i < n - 2) {
    ans.push_back(s[i++]);
    ans.push_back(s[i++]);
    ans.push_back(s[i++]);
  }
  if (t == true) ans.push_back(')');
  cout << ans;
}
