#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int l = s.size();
  vector<char> v;
  if (s[0] == '-') cout << '(';
  ;
  cout << '$';
  vector<char> dec;
  int check = 0;
  int cnt = 0;
  for (int i = 0; i < l; i++) {
    if (s[i] == '-')
      continue;
    else if (s[i] == '.')
      check = 1;
    else if (!check)
      v.push_back(s[i]);
    else if (check) {
      cnt++;
      dec.push_back(s[i]);
      if (cnt >= 2) break;
    }
  }
  if (cnt == 0) {
    dec.push_back('0');
    dec.push_back('0');
  } else if (cnt == 1)
    dec.push_back('0');
  for (int i = 0; i < v.size(); i++) {
    if (v.size() % 3 == 2) {
      cout << v[i];
      if (i % 3 == 1 && i != v.size() - 1) cout << ',';
    } else if (v.size() % 3 == 1) {
      cout << v[i];
      if (i % 3 == 0 && i != v.size() - 1) cout << ',';
    } else {
      cout << v[i];
      if (i % 3 == 2 && i != v.size() - 1) cout << ',';
    }
  }
  cout << '.';
  for (auto y : dec) cout << y;
  if (s[0] == '-') cout << ')';
}
