#include <bits/stdc++.h>
using namespace std;
char s[110];
int main() {
  gets(s);
  int n = strlen(s);
  s[n] = '0', s[n + 1] = '0', s[n + 2] = '0';
  int flag = 0;
  int k = 0;
  for (int i = 0; i <= n - 1; i++) {
    if (s[0] == '-' && flag == 0) {
      cout << "(";
      flag = 1;
    }
    if (s[i] == '.') k = i;
  }
  if (k == 0) k = n;
  cout << "$";
  if (flag == 1) {
    for (int i = 1; i <= k - 1; i++) {
      if ((k - i) % 3 == 0 && i != 1) cout << ",";
      cout << s[i];
    }
  } else {
    for (int i = 0; i <= k - 1; i++) {
      if ((k - i) % 3 == 0 && i != 0) cout << ",";
      cout << s[i];
    }
  }
  cout << ".";
  for (int i = k + 1; i <= k + 2; i++) {
    cout << s[i];
  }
  if (flag == 1) cout << ")";
  cout << endl;
  return 0;
}
