#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool sign = false;
  if (s[0] == '-') {
    sign = true;
    s.erase(s.begin());
  }
  string::iterator fraction = find(s.begin(), s.end(), '.');
  string fraction_string = ".";
  if (fraction == s.end()) {
    fraction_string += "00";
  } else {
    fraction_string += string(fraction + 1, s.end());
    while (fraction_string.size() - 1 < 2) fraction_string += "0";
    fraction_string.resize(3);
  }
  string integer_string = string(s.begin(), fraction);
  vector<string> numbers;
  int i = integer_string.size() - 3;
  for (; i >= 0; i -= 3) {
    numbers.push_back(string(s.begin() + i, s.begin() + i + 3));
  }
  if (i > -3) {
    i += 3;
    numbers.push_back(string(s.begin(), s.begin() + i));
  }
  reverse(numbers.begin(), numbers.end());
  if (sign) {
    cout << "($";
  } else {
    cout << "$";
  }
  for (i = 0; i < numbers.size(); i++) {
    if (i != 0) cout << ",";
    cout << numbers[i];
  }
  cout << fraction_string;
  if (sign) {
    cout << ")";
  }
  cout << endl;
}
