#include <bits/stdc++.h>
using namespace std;
set<int> s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s, s1 = "", s2 = "";
  int j = 200, p = 0;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '.')
      j = i;
    else if (i > j) {
      s2 += s[i];
    } else if (i < j && s[i] != '-') {
      s1 += s[i];
    } else if (s[i] == '-') {
      p = 1;
    }
  }
  if (s2 == "") {
    s2 = "00";
  }
  string s3 = "";
  if (s1.length() % 3 == 0) {
    for (int i = 0; i < s1.length(); i++) {
      if (i % 3 == 0 && i != 0 && i != s1.length() - 1) {
        s3 += ',';
        s3 += s1[i];
      } else
        s3 += s1[i];
    }
  } else if (s1.length() % 3 != 0) {
    if (s1.length() % 3 == 1) {
      s3 += s1[0];
    } else if (s1.length() % 3 == 2) {
      s3 += s1[0];
      s3 += s1[1];
    }
    int c = 0;
    for (int i = s3.length(); i < s1.length(); i++) {
      if (c % 3 == 0 && i != s1.length() - 1) {
        s3 += ',';
        s3 += s1[i];
      } else
        s3 += s1[i];
      c++;
    }
  }
  string s4 = "";
  if (s2.length() >= 2) {
    s4 += s2[0];
    s4 += s2[1];
  } else {
    s4 += s2[0];
    s4 += '0';
  }
  if (p == 1) {
    cout << '(' << '$' << s3 << '.' << s4 << ')' << endl;
  } else {
    cout << '$' << s3 << '.' << s4 << endl;
  }
  return 0;
}
