#include <bits/stdc++.h>
using namespace std;
int main() {
  char x[200000];
  cin >> x;
  while (strstr(x, "ST") != NULL) {
    vector<char> ans;
    for (int i = 0; x[i] != '\0'; ++i) {
      if (x[i] == 'S' && x[i + 1] == 'T') {
        ++i;
        continue;
      } else {
        ans.push_back(x[i]);
      }
    }
    string buff(ans.begin(), ans.end());
    strcpy(x, buff.c_str());
  }
  cout << x << endl;
  return 0;
}
