#include <bits/stdc++.h>
char ch[110];
char integer[110], frac[110];
int len, c1, c2;
bool pm;
int main(void) {
  int i;
  scanf("%s", &ch[1]);
  len = strlen(&ch[1]);
  if (ch[1] == '-')
    pm = 1;
  else
    pm = 0;
  for (i = 1; i <= len; i++) {
    if (i == 1 && ch[1] == '-') continue;
    if (ch[i] == '.') break;
    integer[++c1] = ch[i];
  }
  i++;
  for (; i <= len; i++) {
    frac[++c2] = ch[i];
    if (c2 == 2) break;
  }
  if (c2 < 2) {
    for (;;) {
      frac[++c2] = '0';
      if (c2 == 2) break;
    }
  }
  if (pm) printf("(");
  printf("$");
  for (i = 1; i <= c1; i++) {
    printf("%c", integer[i]);
    if ((c1 - i) % 3 == 0 && i != c1) printf(",");
  }
  printf(".");
  printf("%c%c", frac[1], frac[2]);
  if (pm) printf(")");
  return false;
}
