#include <bits/stdc++.h>
using namespace std;
int main() {
  int k = 0, t = 0, l = 0, q = 0, z = 0;
  string s, s1, s2;
  cin >> s;
  if (s[0] == '-') {
    q = -1;
    s.erase(0, 1);
  }
  k = s.size();
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '.') {
      t = i;
      break;
    }
  if (t == 0) s += ".00", t = k;
  if (s.size() - t == 2) s += "0";
  l = t;
  if (q == -1) cout << "(";
  cout << "$";
  if (l % 3 != 0)
    z = l % 3;
  else
    z = 3;
  for (int i = 0; i < l + 3; i++) {
    if (i == z && z < l) {
      cout << ",";
      z += 3;
    }
    if (s[i] != '-') cout << s[i];
  }
  if (q == -1) cout << ")";
  return 0;
}
