/* decom.c -- decompress files made by precom.c
	Usage: precom
	Reads stdin and writes decompressed file onto stdout
  */

#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>

typedef long PosType;
#define MAXN 100000000
char a[MAXN];	/* Output string storage */
PosType n=0;	/* File size */

void addchar(char c)
{	a[n++] = c;
	putchar(c);
}

int getint() /* gobble nondigit at end */
{	int c, n = 0;
	for (;;) {
		c = getchar(); /* danger: no EOF */
		if (!isdigit(c)) break;
		n = 10*n + c - '0';
	}
	return n;
}

int main()
{	PosType i;
	int c, start, len;
	while ((c=getchar()) != EOF) {
		if (c == '<') {
			c = getchar(); /* danger: no EOF */
			if (c == '<') { /* quoted < */
				addchar('<');
			} else {
				ungetc(c, stdin);
				start = getint();
				len = getint();
				for (i = start; i < start+len; i++)
					addchar(a[i]);
			}
		} else
			addchar(c);
	}
	return 0;
}

