#!/usr/bin/env python
import sys, re, htmlentitydefs
from BaseHTMLProcessor import BaseHTMLProcessor

UNENTITIZE_CHARACTERS=['<', '>']
unentitizeCodepoints = [ord(x) for x in UNENTITIZE_CHARACTERS]

class HTMLUnentitizer(BaseHTMLProcessor):
    def reset(self):
        self.blockquote = 0
        BaseHTMLProcessor.reset(self)

    def start_blockquote(self, attrs):
        self.blockquote += 1                 
        self.unknown_starttag("blockquote", attrs)

    def end_blockquote(self):
        self.blockquote -= 1                 
        self.unknown_endtag("blockquote")

    def handle_entityref(self, ref):
        if self.blockquote > 0:
            try:
                cp = htmlentitydefs.name2codepoint[ref]
                if cp in unentitizeCodepoints:
                    self.pieces.append(chr(cp))
                    return
            except KeyError:
                pass
        BaseHTMLProcessor.handle_entityref(self, ref)

def main():
    h = sys.stdin.read()
    u = HTMLUnentitizer()
    u.feed(h)
    print(u.output())
    
if __name__ == "__main__":
    main()
