• + 1 comment
    import sys, re
    
    T = sys.stdin.read().splitlines()
    T = [T[1:] if len(T)<90 else T[1:91]][0]
    
    UID = re.compile(
        r"(?!.*(.).*\1)"
        r"(?=^[a-zA-Z0-9]{10}$)"
        r"(?=(.*[A-Z].*){2,})"
        r"(?=(.*\d.*){3,})"
    )
    
    for line in T:
        if UID.search(line):
            print('Valid')
        else:
            print('Invalid')