#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s, ans, new_string;
  cin >> s;
  int n = (int)s.size();
  if (s[0] == '-') {
    ans += '(';
  }
  ans += '$';
  int pos = n;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') {
      pos = i;
      break;
    }
  }
  int cnt = 0;
  for (int i = pos - 1; i >= 0; i--) {
    if (s[i] == '-') continue;
    if (cnt != 0 && cnt % 3 == 0) {
      new_string += ',';
    }
    new_string += s[i];
    cnt++;
  }
  reverse(new_string.begin(), new_string.end());
  ans += new_string;
  ans += '.';
  for (int i = 1; i <= 2; i++) {
    if (s[pos + i] > '9' || s[pos + i] < '0') {
      ans += '0';
    } else
      ans += s[pos + i];
  }
  if (s[0] == '-') {
    ans += ')';
  }
  cout << ans;
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
