sed -n '
	: restart
	/^PROMPT>$/{
		h
		$p
		n
		/^>$/{
			H
			${x;p;}
			n
			/^<$/d
		}
		x
		p
		x
		b restart
	}
	p
'
