#include <bits/stdc++.h>
using namespace std;
string S, ans, curans, non;
bool mus;
int main() {
  int len, k, i, j, i0 = 0, d = 0;
  cin >> S;
  mus = false;
  len = S.length();
  if (S[0] == '-') {
    mus = true;
    i0 = 1;
  }
  for (i = i0; i < len; i++)
    if (S[i] == '.') break;
  d = -1;
  for (j = i - 1; j >= i0; j--) {
    if (d % 3 == 2) curans += ",";
    d += 1;
    curans += S[j];
  }
  if (mus) ans += "(";
  ans += "$";
  for (j = curans.length() - 1; j >= 0; j--) ans += curans[j];
  ans += ".";
  d = i + 2;
  for (i += 1; i < len; i++) {
    non += S[i];
    if (i == d) break;
  }
  if (non.size() == 0)
    non += "00";
  else if (non.size() == 1)
    non += "0";
  ans += non;
  if (mus) ans += ")";
  cout << ans << endl;
}
