#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  deque<char> ans;
  int ind = s.find('.'), coma = 1;
  for (int i = ind != -1 ? ind - 1 : s.size() - 1; i >= 0; i--) {
    if (s[i] != '-') {
      ans.push_front(s[i]);
      if (coma % 3 == 0 && !(i == 0 || (i == 1 && s[0] == '-'))) {
        ans.push_front(',');
      }
      coma++;
    }
  }
  ans.push_front('$');
  if (s[0] == '-') ans.push_front('(');
  ans.push_back('.');
  if (ind == -1) ind = s.size() + 1;
  if (ind + 1 < s.size())
    ans.push_back(s[ind + 1]);
  else
    ans.push_back('0');
  if (ind + 2 < s.size())
    ans.push_back(s[ind + 2]);
  else
    ans.push_back('0');
  if (s[0] == '-') ans.push_back(')');
  string tuna;
  tuna.assign(ans.begin(), ans.end());
  cout << tuna << '\n';
  return 0;
}
