#include <bits/stdc++.h>
using namespace std;
char s[111], c[111], d[111], res[222];
string S;
int main() {
  int i, j, ok = 0, k, t, ct = 0, dt = 0, n;
  cin >> S;
  for (i = 0; i < S.length(); i++) s[i] = S[i];
  n = S.length();
  for (i = n; i <= n + 3; i++) s[i] = '0';
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      for (j = i - 1; j > 0; j--) {
        c[++ct] = s[j];
      }
      if (s[0] != '-') c[++ct] = s[0];
      d[++dt] = s[i + 1];
      d[++dt] = s[i + 2];
      ok = 1;
      break;
    }
  }
  if (!ok) {
    if (s[0] == '-') {
      cout << "($";
      k = 0;
      t = 0;
      for (i = n - 1; i >= 1; i--) {
        k++;
        res[++t] = s[i];
        if (k % 3 == 0) {
          res[++t] = ',';
          k = 0;
        }
      }
      if (res[t] != ',') cout << res[t];
      for (i = t - 1; i >= 1; i--) {
        cout << res[i];
      }
      cout << ".00)";
      return 0;
    } else {
      cout << "$";
      k = 0;
      t = 0;
      for (i = n - 1; i >= 0; i--) {
        k++;
        res[++t] = s[i];
        if (k % 3 == 0) {
          res[++t] = ',';
          k = 0;
        }
      }
      if (res[t] != ',') cout << res[t];
      for (i = t - 1; i >= 1; i--) {
        cout << res[i];
      }
      cout << ".00";
      return 0;
    }
  } else {
    if (s[0] == '-') {
      cout << "($";
      k = 0;
      t = 0;
      for (i = 1; i <= ct; i++) {
        k++;
        res[++t] = c[i];
        if (k % 3 == 0) {
          res[++t] = ',';
          k = 0;
        }
      }
      if (res[t] != ',') cout << res[t];
      for (i = t - 1; i >= 1; i--) {
        cout << res[i];
      }
      cout << ".";
      cout << d[1] << d[2] << ")";
      return 0;
    } else {
      cout << "$";
      k = 0;
      t = 0;
      for (i = 1; i <= ct; i++) {
        k++;
        res[++t] = c[i];
        if (k % 3 == 0) {
          res[++t] = ',';
          k = 0;
        }
      }
      if (res[t] != ',') cout << res[t];
      for (i = t - 1; i >= 1; i--) {
        cout << res[i];
      }
      cout << ".";
      cout << d[1] << d[2];
      return 0;
    }
  }
  return 0;
}
