#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-10;
template <typename T, typename S>
vector<T>& operator<<(vector<T>& a, S b) {
  a.push_back(b);
  return a;
}
template <typename T>
void operator>>(vector<T>& a, int b) {
  while (b--)
    if (!a.empty()) a.pop_back();
}
bool isprime(int n) {
  if (n < 2) return false;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
long long b_pow(long long x, long long n) {
  return n ? b_pow(x * x, n / 2) * (n % 2 ? x : 1) : 1ll;
}
string itos(int n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
string read() {
  string s;
  char c;
  while (cin >> c && c != '>') s += c;
  if (s.size() == 0) exit(0);
  return s.substr(1);
}
int f(string s) { return s[0] == '/'; }
string get(string s) {
  if (s[0] == '/') return s.substr(1);
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, ret = 0;
  stack<string> s;
  while (1) {
    string t = read();
    if (t == "") return 0;
    if (s.size() == 0 || (!f(t) || get(s.top()) != get(t))) {
      cout << string(s.size() * 2, ' ') << "<" << t << ">" << endl;
      s.push(t);
    } else {
      s.pop();
      cout << string(s.size() * 2, ' ') << "<" << t << ">" << endl;
    }
  }
}
