#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b > 0 ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long read() {
  long long X = 0;
  bool flag = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = 0;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    X = (X << 1) + (X << 3) + ch - '0';
    ch = getchar();
  }
  if (flag) return X;
  return ~(X - 1);
}
mt19937 rnd(time(0));
int main() {
  string s;
  int x;
  vector<char> v, r;
  cin >> s;
  if (s[0] == '-')
    cout << "($", x = 1;
  else
    cout << "$", x = 0;
  int i;
  for (i = x; i < s.length(); i++) {
    if (s[i] == '.') break;
    v.push_back(s[i]);
  }
  i++;
  for (i; i < s.length(); i++) {
    r.push_back(s[i]);
    if (r.size() == 2) break;
  }
  while (r.size() < 2) r.push_back('0');
  if (v.size() <= 3)
    for (int i = 0; i < v.size(); i++) cout << v[i];
  else {
    int u = 0;
    for (u; u < (v.size() - 1) % 3 + 1; u++) cout << v[u];
    for (u; u < v.size(); u += 3) cout << ',' << v[u] << v[u + 1] << v[u + 2];
  }
  cout << '.';
  for (int i = 0; i < 2; i++) cout << r[i];
  if (s[0] == '-') cout << ')';
  cout << "\n";
}
