#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:33554432")
using namespace std;
string s;
int neg = 0;
void f(string s) {
  vector<string> v;
  while (1) {
    v.push_back(s.substr(max((int)s.size() - 3, 0)));
    if (s.size() <= 3) break;
    s = s.substr(0, s.size() - 3);
  }
  for (int i = v.size() - 1; i; --i) cout << v[i] << ",";
  cout << v[0] << ".";
}
int main() {
  cin >> s;
  if (s[0] == '-') {
    neg = 1;
    cout << "(";
  }
  cout << "$";
  int dot;
  for (dot = neg; dot < s.size(); ++dot)
    if (s[dot] == '.') break;
  if (dot == s.size()) s += '.';
  while (s.size() - dot <= 2) s += '0';
  f(s.substr(neg, dot - neg));
  cout << s.substr(dot + 1, 2);
  if (neg)
    cout << ")" << endl;
  else
    cout << endl;
  return 0;
}
