#include <bits/stdc++.h>
using namespace std;
char a[1000];
int main() {
  string s;
  cin >> s;
  int n = s.length();
  bool p = 0;
  int k = n - 1;
  for (int i = 0; i < n; i++)
    if (s[i] == '.') {
      p = 1;
      k = i;
      break;
    }
  bool f = 0;
  if (s[0] == '-') f = 1;
  char temp = s[n - 1];
  int x;
  int y;
  if (p)
    y = k;
  else
    y = k + 1;
  if (f) y--;
  x = y % 3;
  int j = 0;
  bool key = 0;
  if (f) cout << '(';
  cout << '$';
  for (int i = 0; i < n; i++) {
    if (i == k) {
      if (i == n - 1) cout << s[i];
      cout << ".";
      break;
    }
    if (f)
      if (i > 1) j++;
    if (f == 0)
      if (i > 0) j++;
    if (key == 0 && j == x) {
      if (x != 0) cout << ",";
      j = 1;
      key = 1;
    }
    if (s[i] != '-') cout << s[i];
    if (key && j == 3) {
      if (i + 1 != k) cout << ',';
      j = 0;
    }
  }
  if (k == n - 1) {
    cout << "00";
  } else {
    if (k + 1 == n - 1) {
      cout << s[k + 1] << '0';
    }
    if (k + 2 <= n - 1) {
      cout << s[k + 1] << s[k + 2];
    }
  }
  if (f) cout << ')';
  return 0;
}
