#include <bits/stdc++.h>
char s[105];
int S = 0;
bool b = 0;
int main() {
  scanf("%s", s);
  int sl = strlen(s);
  if (s[0] == '-')
    S = 1;
  else
    S = 0;
  if (S)
    printf("($");
  else
    printf("$");
  int dot = sl;
  for (int i = 0; i <= sl - 1; ++i)
    if (s[i] == '.') {
      dot = i;
      break;
    }
  for (int i = S; i <= (dot - 1) % 3; ++i) printf("%c", s[i]);
  for (int i = (dot - 1) % 3 + 1; i <= dot - 1; ++i) {
    if (i != S && (i - 1) % 3 == (dot - 1) % 3) printf(",");
    printf("%c", s[i]);
  }
  if (dot < sl) {
    printf(".");
    if (sl - dot == 2)
      printf("%c0", s[dot + 1]);
    else
      printf("%c%c", s[dot + 1], s[dot + 2]);
  } else
    printf(".00");
  if (S) printf(")");
  printf("\n");
  return 0;
}
