#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  string a, b;
  int check = 0;
  int ch = 0;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '.') check = 1;
    if (check == 0) {
      if (s[i] != '-')
        a += s[i];
      else
        ch = 1;
    } else if (b.length() < 3)
      b += s[i];
  }
  if (b.length() == 0) {
    b = ".00";
  } else if (b.length() == 2) {
    b += '0';
  }
  check = a.length();
  check = check % 3;
  if (check == 0) check = 3;
  string ans;
  long long k = 0;
  if (ch) ans += '(';
  ans += '$';
  for (long long i = 0; i < a.length(); i++) {
    if (k == check) {
      k = 0;
      check = 3;
      ans += ',';
    }
    ans += a[i];
    k++;
  }
  ans += b;
  if (ch) ans += ')';
  cout << ans;
}
