#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  multiset<string> p;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if ((s[i] == '<') || (s[i] == '>')) s[i] = ' ';
  }
  istringstream sin(s);
  multiset<string>::iterator it;
  string f;
  while (sin >> f) {
    if (f[0] != '/') {
      p.insert(f);
      cout << string(2 * (p.size() - 1), ' ') << '<' << f << '>' << endl;
    } else {
      cout << string(2 * (p.size() - 1), ' ') << '<' << f << '>' << endl;
      f = f.substr(1);
      it = p.find(f);
      if (it != p.end()) p.erase(it);
    }
  }
}
