#include <bits/stdc++.h>
using namespace std;
string z, s, ori, backside, last, news;
vector<char> v;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> z;
  ori = z;
  if (z[0] == '-')
    cout << "($";
  else
    cout << "$";
  bool ok = false;
  for (int(i) = 0; (i) < (int)(z.length()); (i)++) {
    if (z[i] == '.') ok = true, i++;
    if (ok) backside += z[i];
  }
  if (backside.length() >= 2) {
    last += backside[0];
    last += backside[1];
  } else if (backside.length() == 1) {
    last += backside[0];
    last += '0';
  } else {
    last += '0';
    last += '0';
  }
  for (int(i) = 0; (i) < (int)(z.length()); (i)++) {
    if (z[i] == '.') break;
    if (z[i] != '-') s += z[i];
  }
  int cnt = 0;
  for (int(i) = (s.length() - 1); (i) >= 0; (i)--) {
    if (cnt == 3) news += ',', cnt = 0;
    news += s[i];
    cnt++;
  }
  reverse(news.begin(), news.end());
  cout << news << '.' << last;
  if (z[0] == '-') cout << ")";
  return 0;
}
