#include <bits/stdc++.h>
int stack[26][200];
char xml[200 * 5 + 10];
int main() {
  int i, j, l;
  int space, idx;
  while (scanf("%s", xml) != EOF) {
    for (i = 0; i < 26; i++) {
      stack[i][0] = 0;
    }
    space = 0;
    for (i = 1; xml[i]; i += 3) {
      if (xml[i] == '/') {
        ++i;
        idx = xml[i] - 'a';
        space = l = stack[idx][stack[idx][0]--];
        for (j = 1; j <= l; j++) {
          putchar(' ');
        }
        printf("</%c>\n", xml[i]);
      } else {
        for (j = 1; j <= space; j++) {
          putchar(' ');
        }
        printf("<%c>\n", xml[i]);
        idx = xml[i] - 'a';
        stack[idx][++stack[idx][0]] = space;
        space += 2;
      }
    }
  }
  return 0;
}
