• + 0 comments

    vau!

    import re
    
    regex = re.compile(r'^[_\.]\d+[a-zA-Z]*_?$')
    
    n = int(input())
    for _ in range(n):
        print('VALID' if regex.match(input()) else 'INVALID')