#include <bits/stdc++.h>
using namespace std;
int main() {
  char str1[110];
  char str2[200];
  int i, j;
  for (i = 0; i < 110; i++) str1[i] = '0';
  cin >> str1;
  str2[0] = '$';
  int flag = 0;
  int l = strlen(str1);
  i = 0;
  j = 1;
  if (str1[0] == '-') i++;
  int k;
  for (k = i; k < strlen(str1); k++) {
    if (str1[k] == '.') {
      flag = 1;
      l = k;
      break;
    }
  }
  if (l - i + 1 > 1) {
    int l2;
    l2 = (l - i) % 3;
    if (l2 == 0) l2 = 3;
    for (; i < l; i++) {
      if (str1[i] <= '9' && str1[i] >= '0') {
        str2[j++] = str1[i];
        l2--;
      }
      if (!l2) {
        if (i + 3 >= l)
          l2 = 100;
        else {
          l2 = 3;
          str2[j++] = ',';
        }
      }
    }
    str2[j++] = '.';
    str2[j++] = str1[i + 1] == '\0' ? '0' : str1[i + 1];
    str2[j++] = str1[i + 2] == '\0' ? '0' : str1[i + 2];
  } else {
    for (k = 0; k < 4; k++) {
      str2[j++] = str1[i++];
      if (str2[j - 1] == '\0') str2[j - 1] = '0';
    }
  }
  str2[j] = '\0';
  if (str1[0] == '-')
    cout << "(" << str2 << ")" << endl;
  else
    cout << str2 << endl;
}
