#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string a;
  cin >> a;
  int j = -1;
  string s;
  for (int i = 0; i < a.size(); ++i) {
    if (a[i] == '-') continue;
    if (a[i] == '.') {
      j = i + 1;
      break;
    }
    s += a[i];
  }
  deque<char> d;
  int kol = 1;
  for (int i = s.size() - 1; i >= 0; --i) {
    if (kol > 3) {
      d.push_front(',');
      kol = 1;
    }
    d.push_front(s[i]);
    ++kol;
  }
  d.push_front('$');
  if (j == -1) {
    d.push_back('.');
    d.push_back('0');
    d.push_back('0');
  } else if (j + 2 > a.size()) {
    d.push_back('.');
    d.push_back(a.back());
    d.push_back('0');
  } else {
    d.push_back('.');
    d.push_back(a[j]);
    d.push_back(a[j + 1]);
  }
  if (a[0] == '-') {
    d.push_front('(');
    d.push_back(')');
  }
  for (char i : d) cout << i;
  return 0;
}
