#include <bits/stdc++.h>
using namespace std;
const int mod = 1000003;
int main() {
  string str;
  cin >> str;
  int neg = 0;
  int d = 0;
  string a = "";
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == '-')
      neg = 1;
    else if (str[i] == '.')
      d = 1, a += str[i];
    else
      a += str[i];
  }
  if (d == 0)
    a += ".00";
  else
    a += "00";
  string res = "";
  int pos = a.find('.');
  a = a.substr(0, pos + 3);
  int cnt = 0;
  for (int i = a.size() - 1; i >= pos; i--) res += a[i];
  for (int i = pos - 1; i >= 0; i--) {
    res += a[i];
    cnt++;
    if (i == 0) break;
    if (cnt == 3) {
      res += ',';
      cnt = 0;
    }
  }
  reverse(res.begin(), res.end());
  if (neg == 1) cout << "(";
  cout << '$';
  cout << res;
  if (neg == 1) cout << ')' << endl;
  return 0;
}
