#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  bool ms = false;
  string a;
  string b;
  if (s[0] == '-') ms = true;
  bool flag = false;
  bool p = ms;
  for (int i = 0; i < s.size(); i++) {
    if (p) {
      p = false;
      continue;
    }
    if (s[i] == '.') {
      flag = true;
      continue;
    }
    if (!flag)
      a.push_back(s[i]);
    else
      b.push_back(s[i]);
  }
  int l = a.size();
  if (ms) cout << "(";
  cout << "$";
  for (int i = 0; i < l; i++) {
    if ((l - i) % 3 == 0 && i != 0) cout << ",";
    cout << a[i];
  }
  cout << ".";
  if (b.size() >= 2)
    cout << b[0] << b[1];
  else if (b.size() == 1)
    cout << b[0] << '0';
  else
    cout << "00";
  if (ms) cout << ")";
  return 0;
}
