#include <bits/stdc++.h>
using namespace std;
char str[200];
int main() {
  scanf("%s", str);
  bool minus = str[0] == '-';
  bool first = true;
  int start = (minus ? 1 : 0), end = strlen(str) - 1, frac[2] = {0, 0};
  for (int i = start; str[i]; ++i) {
    if (str[i] == '.') {
      first = false;
      if (str[i + 1]) {
        frac[0] = str[i + 1] - '0';
        if (str[i + 2]) {
          frac[1] = str[i + 2] - '0';
        }
      }
      end = i - 1;
    } else if (str[i] != '0' && first) {
      start = i;
      first = false;
    }
  }
  if (minus) printf("(");
  printf("$");
  int k = (end - start + 1) % 3;
  int kk = (end - start + 1) / 3;
  for (int i = 0; i < k; ++i) printf("%c", str[i + (minus ? 1 : 0)]);
  if (k && kk > 0) printf(",");
  for (int i = start + k, k = 0; i <= end; ++i, k = (k + 1) % 3) {
    printf("%c", str[i]);
    if (k == 2 && i != end) printf(",");
  }
  printf(".%d%d", frac[0], frac[1]);
  if (minus) printf(")");
  printf("\n");
  return 0;
}
