f=lambda n:n=="#"or(n[0]=="#")*all(any([47<ord(c)<58,64<ord(c)<91,ord(c)==95,96<ord(c)<123])for c in n[1:]+"0")*~(47<ord(n[1])<58)
print(f("#d"))
print(f("#"))
Zj1sYW1iZGEgbjpuPT0iIyJvcihuWzBdPT0iIyIpKmFsbChhbnkoWzQ3PG9yZChjKTw1OCw2NDxvcmQoYyk8OTEsb3JkKGMpPT05NSw5NjxvcmQoYyk8MTIzXSlmb3IgYyBpbiBuWzE6XSsiMCIpKn4oNDc8b3JkKG5bMV0pPDU4KQpwcmludChmKCIjZCIpKQpwcmludChmKCIjIikp