#include <bits/stdc++.h>
using namespace std;
struct node {
  char c;
  int d;
  int flag;
};
char s[1005];
vector<int> leaval[30];
vector<node> v;
int n;
int main() {
  while (scanf("%s", s) != EOF) {
    v.clear();
    n = 0;
    for (int i = 0; i <= 29; i++) leaval[i].clear();
    int l = strlen(s);
    int i = 0;
    node p;
    p.c = '#';
    p.d = 0;
    p.flag = 1;
    v.push_back(p);
    while (i < l) {
      if (s[i] == '<' || s[i] == '>') {
        i++;
        continue;
      } else if (s[i] == '/') {
        i++;
        node p;
        p.c = s[i];
        p.d = leaval[s[i] - 'a'].back();
        p.flag = 1;
        leaval[s[i] - 'a'].pop_back();
        v.push_back(p);
      } else if (s[i] >= 'a' && s[i] <= 'z') {
        node p;
        p.c = s[i];
        node top = v.back();
        if (top.flag == 1) {
          p.d = top.d;
          p.flag = 0;
        } else {
          p.d = top.d + 1;
          p.flag = 0;
        }
        leaval[s[i] - 'a'].push_back(p.d);
        v.push_back(p);
      }
      i++;
    }
    for (i = 0; i < (int)v.size(); i++) {
      node p = v[i];
      if (p.c == '#') continue;
      for (int j = 1; j <= 2 * p.d; j++) printf(" ");
      if (p.flag == 0)
        printf("<%c>\n", p.c);
      else
        printf("</%c>\n", p.c);
    }
  }
  return 0;
}
