#include <bits/stdc++.h>
using namespace std;
long long mode = pow(10, 9) + 7;
bool cmp(pair<long double, int> x, pair<long double, int> y) {
  return x.first < y.first;
}
const long long maxn = 2 * 1e5 + 5;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  bool minus = false, point = false;
  if (s[0] == '-') minus = true;
  long long n = s.size();
  if (minus) {
    string t = "";
    for (int i = 1; i < n; i++) {
      t += s[i];
    }
    s = t;
    n--;
  }
  int ind = -1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      ind = i;
      break;
    }
  }
  if (ind != -1) {
    string t = "";
    for (int i = 0; i <= ind; i++) {
      t += s[i];
    }
    if (ind + 1 < n) {
      t += s[ind + 1];
      ind++;
    } else
      t += "0";
    if (ind + 1 < n) {
      t += s[ind + 1];
    } else
      t += "0";
    s = t;
    n = t.size();
  } else {
    s += ".00";
  }
  n = s.size();
  ind = 1;
  string t = "";
  t += s[n - 1];
  t += s[n - 2];
  t += s[n - 3];
  for (int i = n - 4; i >= 0; i--) {
    if (ind % 3 == 0) {
      t += s[i];
      if (i != 0) t += ",";
      ind = 0;
    } else
      t += s[i];
    ind++;
  }
  reverse(t.begin(), t.end());
  if (minus) {
    cout << "("
         << "$" << t << ")"
         << "\n";
  } else
    cout << "$" << t << "\n";
  return 0;
}
