#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  int dot = s.find(".");
  string s1 = "($", s2 = "$", s3 = ")";
  list<char> qq;
  list<char> aa;
  int dc = dot;
  int dd = dot;
  if (dot != string ::npos) {
    if (s.front() == '-') {
      int l = dot - 1;
      dc--;
      int comma = 0;
      while (l--) {
        qq.push_front(s[dc]);
        comma++;
        if (comma == 3 && dc != 1) {
          qq.push_front(',');
          comma = 0;
        }
        dc--;
      }
      int three = 0;
      while (three < 3) {
        if (s[dd] != '\0')
          aa.push_back(s[dd]);
        else
          aa.push_back('0');
        three++;
        dd++;
      }
      cout << s1;
      for (auto i : qq) cout << i;
      for (auto i : aa) cout << i;
      cout << s3;
    } else {
      int l = dot;
      dc--;
      int comma = 0;
      while (l--) {
        qq.push_front(s[dc]);
        comma++;
        if (comma == 3 && dc != 0) {
          qq.push_front(',');
          comma = 0;
        }
        dc--;
      }
      int three = 0;
      while (three < 3) {
        if (s[dd] != '\0')
          aa.push_back(s[dd]);
        else
          aa.push_back('0');
        three++;
        dd++;
      }
      cout << s2;
      for (auto i : qq) cout << i;
      for (auto i : aa) cout << i;
    }
  } else {
    string no = ".00";
    int xx = s.length();
    --xx;
    int l;
    if (s.front() == '-') {
      l = xx;
      int comma = 0;
      while (l--) {
        qq.push_front(s[xx]);
        comma++;
        if (comma == 3 && xx != 1) {
          qq.push_front(',');
          comma = 0;
        }
        xx--;
      }
      cout << s1;
      for (auto i : qq) cout << i;
      for (auto i : aa) cout << i;
      cout << no << s3;
    } else {
      l = xx + 1;
      int comma = 0;
      while (l--) {
        qq.push_front(s[xx]);
        comma++;
        if (comma == 3 && xx != 0) {
          qq.push_front(',');
          comma = 0;
        }
        xx--;
      }
      cout << s2;
      for (auto i : qq) cout << i;
      for (auto i : aa) cout << i;
      cout << no;
    }
  }
}
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
