#include <bits/stdc++.h>
using namespace std;
int dx[8] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy[8] = {1, -1, 0, -1, 1, 1, 0, -1};
int main() {
  ios::sync_with_stdio(false);
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  string s, ans = "$";
  cin >> s;
  int dot = ((int)((s).size()));
  for (int i = 0; i < ((int)((s).size())); i++) {
    if (s[i] == '.') {
      dot = i;
      break;
    }
  }
  if (dot == ((int)((s).size()))) s += ".00";
  int comma = 0;
  comma = (dot >= 3) ? (dot + 1) % 3 : -1;
  for (int i = 0, j = 2 - comma; i <= dot; i++, j++) {
    ans += s[i];
    if (comma != -1 && j % 3 == 0 && s[i + 1] != '.' && s[i] != '-') ans += ',';
  }
  ans += s[dot + 1];
  if (((int)((s).size())) - dot == 2)
    ans += '0';
  else
    ans += s[dot + 2];
  if (ans[1] == '-') {
    ans[0] = '(';
    ans[1] = '$';
    ans += ')';
  }
  cout << ans;
  return 0;
}
