#include <bits/stdc++.h>
using namespace std;
int getint() {
  unsigned int c;
  int x = 0;
  while (((c = getchar()) - '0') >= 10) {
    if (c == '-') return -getint();
    if (!~c) exit(0);
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while (((c = getchar()) - '0') < 10);
  return x;
}
int getc_str(char str[]) {
  unsigned int c, n = 0;
  for (; (c = getchar()) <= ' ';)
    if (!~c) exit(0);
  do {
    str[n++] = c;
  } while ((c = getchar()) > ' ');
  str[n] = '\0';
  return n;
}
char in[2000];
int main() {
  int i, j, tcc, tc = 1;
  for (tcc = 0; tcc < tc; tcc++) {
    int n = getc_str(in);
    stack<char> stk;
    int depth = 0;
    for (i = 0; i < n - 2; i++) {
      if (in[i] == '<') {
        if (isalpha(in[i + 1])) {
          for (j = 0; j < 2 * depth; j++) putchar(' ');
          putchar('<'), putchar(in[i + 1]), putchar('>');
          puts("");
          stk.push(in[i + 1]);
          depth++;
        } else {
          char ch = in[i + 2];
          if (stk.top() == ch) {
            depth--;
            for (j = 0; j < 2 * depth; j++) putchar(' ');
            putchar('<'), putchar('/'), putchar(ch), putchar('>');
            puts("");
            stk.pop();
          }
        }
      }
    }
  }
  return 0;
}
