#include <bits/stdc++.h>
using namespace std;
int main() {
  int flag, c = 0, k;
  string s;
  vector<char> v;
  cin >> s;
  if (s[0] == '-')
    cout << "("
         << "$";
  else
    cout << "$";
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '.') {
      flag = 1;
      k = i;
      break;
    } else
      flag = 0;
  }
  if (flag == 1) {
    if (s[0] != '-') {
      for (int j = k - 1; j >= 0; j--) {
        v.push_back(s[j]);
        c++;
        if (j != 0) {
          if (c % 3 == 0) v.push_back(',');
        }
      }
    } else {
      for (int j = k - 1; j > 0; j--) {
        v.push_back(s[j]);
        c++;
        if (j != 1) {
          if (c % 3 == 0) v.push_back(',');
        }
      }
    }
  } else if (flag == 0) {
    if (s[0] != '-') {
      for (int j = (s.size() - 1); j >= 0; j--) {
        v.push_back(s[j]);
        c++;
        if (j != 0) {
          if (c % 3 == 0) v.push_back(',');
        }
      }
    } else {
      for (int j = (s.size() - 1); j > 0; j--) {
        v.push_back(s[j]);
        c++;
        if (j != 1) {
          if (c % 3 == 0) v.push_back(',');
        }
      }
    }
  }
  reverse(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) cout << v[i];
  if (flag == 0)
    cout << "." << 0 << 0;
  else if (flag == 1) {
    cout << ".";
    if (s.size() - k - 1 >= 2)
      cout << s[k + 1] << s[k + 2];
    else
      cout << s[k + 1] << 0;
  }
  if (s[0] == '-') cout << ")";
}
