#include <bits/stdc++.h>
using namespace std;
void Q_Q() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
int main() {
  Q_Q();
  string s;
  cin >> s;
  deque<char> dq;
  int a = s.find('.');
  if (a != -1) {
    int c = 0;
    bool found = 0;
    for (int i = a - 1; i >= 0; i--) {
      if (s[i] != '-') {
        if (c == 3) {
          dq.push_front(',');
          dq.push_front(s[i]);
          c = 0;
        } else
          dq.push_front(s[i]);
        c++;
      } else {
        dq.push_front('$');
        dq.push_front('(');
        found = 1;
        break;
      }
    }
    if (!found) dq.push_front('$');
    c = 0;
    dq.push_back('.');
    for (int i = a + 1; i < s.length(); i++) {
      if (c == 2) break;
      dq.push_back(s[i]);
      c++;
    }
    if (c < 2) {
      while (c < 2) {
        dq.push_back('0');
        c++;
      }
    }
    if (found) dq.push_back(')');
    for (int i = 0; i < dq.size(); i++) cout << dq[i];
    return 0;
  }
  int c = 0;
  bool found = 0;
  for (int i = s.length() - 1; i >= 0; i--) {
    if (s[i] != '-') {
      if (c == 3) {
        dq.push_front(',');
        dq.push_front(s[i]);
        c = 0;
      } else
        dq.push_front(s[i]);
      c++;
    } else {
      dq.push_front('$');
      dq.push_front('(');
      found = 1;
      break;
    }
  }
  if (!found) dq.push_front('$');
  dq.push_back('.');
  dq.push_back('0');
  dq.push_back('0');
  if (found) dq.push_back(')');
  for (int i = 0; i < dq.size(); i++) cout << dq[i];
  return 0;
}
