#include <bits/stdc++.h>
using namespace std;
string s, t;
long long c;
int i, j, f;
int main() {
  cin >> s;
  if (s[0] == '-') {
    f = 1;
    s.erase(0, 1);
  }
  c = s.find('.');
  if (c != string::npos) {
    if (s.length() - c > 3)
      s.erase(c + 3, s.length() - c - 3);
    else if (s.length() - c == 2)
      s += '0';
  } else
    s += ".00";
  for (i = s.length() - 6; i > 0; i--, j++) {
    if (j % 3 == 0) s.insert(i, ",");
  }
  if (f) {
    cout << "(";
    s += ")";
  }
  cout << "$" << s;
  return 0;
}
