from re import*
n,p=map(input,["Username: ","Password: "])
c,U,L=lambda x:len(split("[%s]"%x,p)),"A-Z","a-z"
print(["OK.","Nope."][any([8>len(p)>12,2>c(U)>9,2>c(L)>9,3>c(U+L),match(U+L,p),2>c("0-9"),n in p,n[::-1]in p,any(c(x)>3 for x in p),len(findall("(.)\\1",p))>1,c(' ^=&#,;"><[|)')>1])])

# --- end of solution ---

# length output: 
print("\nThis python 3 code is {} bytes long.".format(len("""
from re import*
n,p=map(input,["Username: ","Password: "])
c,U,L=lambda x:len(split("[%s]"%x,p)),"A-Z","a-z"
print(["OK.","Nope."][any([8>len(p)>12,2>c(U)>9,2>c(L)>9,3>c(U+L),match(U+L,p),2>c("0-9"),n in p,n[::-1]in p,any(c(x)>3 for x in p),len(findall("(.)\\1",p))>1,c(' ^=&#,;"><[|)')>1])])
""".strip())))

# Additional debug output:
print("\nDebug output: check results (True -> password failed this check)")
print("length 8-12: ", 8>len(p)>12)
print("uppercase 1-8: ", 2>c(U)>9)
print("lowercase 1-8: ", 2>c(L)>9)
print("letters 2+: ", 3>c(U+L))
print("1st is letter: ", bool(match(U+L,p)))
print("has digits: ", 2>c("0-9"))
print("not name: ", n in p)
print("not rev. name: ", n[::-1]in p)
print("max 3 same: ", any(c(x)>3 for x in p))
print("max 1 pair: ", len(findall("(.)\\1",p))>1)
print("no special: ", c(' ^=&#,;"><[|)')>1)
