def check_password_is_valid(pword):
    is_valid = True
    consists_only_of_letters_and_digits = True
    count_digits = 0

    if len(pword) < 6 or len(pword) > 10:
        print("Password must be between 6 and 10 characters")
        is_valid = False

    for el in pword:
        if el.isdigit():
            count_digits += 1
        if not el.isdigit() and not el.isalpha():
            consists_only_of_letters_and_digits = False
            is_valid = False

    if not consists_only_of_letters_and_digits:
        print("Password must consist only of letters and digits")

    if count_digits < 2:
        is_valid = False
        print("Password must have at least 2 digits")

    return is_valid


password = input()
result = check_password_is_valid(password)

if result:
    print("Password is valid")