#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  string s, w = "";
  cin >> s;
  string r = s;
  int c = count(s.begin(), s.end(), '.');
  if (c == 0) {
    w += '0';
    w += '0';
    w += '.';
    int sk = 0;
    for (int i = s.length() - 1; i >= 0; i--) {
      if (s[i] != '-') {
        if (sk == 3) {
          w += ',';
          sk = 0;
        }
        w += s[i];
        sk++;
      }
    }
    w += '$';
    reverse(w.begin(), w.end());
  } else {
    int pos;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == '.') {
        pos = i;
        break;
      }
    }
    if (s[pos + 2])
      w += s[pos + 2];
    else
      w += '0';
    if (s[pos + 1])
      w += s[pos + 1];
    else
      w += '0';
    w += '.';
    int moti = 0;
    for (int j = pos - 1; j >= 0; j--) {
      if (s[j] != '-') {
        if (moti == 3) {
          w += ',';
          moti = 0;
        }
        w += s[j];
        moti++;
      }
    }
    w += '$';
    reverse(w.begin(), w.end());
  }
  if (r[0] != '-') {
    cout << w;
    return 0;
  }
  if (r[0] == '-') {
    w += ')';
    reverse(w.begin(), w.end());
    w += '(';
  }
  reverse(w.begin(), w.end());
  cout << w;
  return 0;
}
