#include <bits/stdc++.h>
using namespace std;
bool flag;
string s, ss;
string s2;
int main() {
  cin >> s;
  if (s.find(".") == s.find("nmsl"))
    s = s + ".0000";
  else
    s = s + "00000";
  if (s[0] == '-') {
    cout << '(';
    cout << '$';
    flag = 1;
    string sss(s, 1, s.find(".") - 1);
    ss = sss;
    string ssss(s, s.find(".") + 1, 2);
    s2 = ssss;
  } else {
    cout << '$';
    string sss(s, 0, s.find("."));
    ss = sss;
    string ssss(s, s.find(".") + 1, 2);
    s2 = ssss;
  }
  int n = ss.size();
  ss = "a" + ss;
  for (int i = 1; i <= n; i++) {
    cout << ss[i];
    if (i % 3 == n % 3 && i != n) cout << ',';
  }
  cout << "." << s2;
  if (flag) cout << ')';
  cout << endl;
  return 0;
}
