#include <bits/stdc++.h>
using namespace std;
int main() {
  char str[200];
  while (scanf("%s", str + 1) != EOF) {
    if (str[1] == '-') printf("(");
    printf("$");
    int len = strlen(str + 1);
    int t = len + 1;
    for (int i = 1; str[i]; i++) {
      if (str[i] == '.') {
        t = i;
        break;
      }
    }
    int r;
    if (str[1] == '-')
      r = (t - 2) % 3;
    else
      r = (t - 1) % 3;
    bool f = false;
    if (r == 0) f = true;
    bool g = false;
    if (str[1] == '-') {
      for (int i = 2; i <= r + 1; i++) {
        printf("%c", str[i]);
        f = true;
        g = true;
      }
    } else {
      for (int i = 1; i <= r; i++) {
        printf("%c", str[i]);
        f = true;
        g = true;
      }
    }
    if (str[1] == '-') {
      for (int i = r + 2; i < t; i++) {
        if ((i - r - 2) % 3 == 0 && f && g) printf(",");
        printf("%c", str[i]);
        g = true;
      }
    } else {
      for (int i = r + 1; i < t; i++) {
        if ((i - r - 1) % 3 == 0 && f && g) printf(",");
        printf("%c", str[i]);
        g = true;
      }
    }
    printf(".");
    if (t + 1 <= len)
      printf("%c", str[t + 1]);
    else
      printf("0");
    if (t + 2 <= len)
      printf("%c", str[t + 2]);
    else
      printf("0");
    if (str[1] == '-') printf(")");
    printf("\n");
  }
  return 0;
}
