def type_analysis(year):
    """
    Takes a valid year and outputs its type (Leap, later, middle, previous ou anomalous).
    :param year: the year to analyze.
    :return: binary list with the year type (string) and its list index (0-4).
    """
    types = ['Leap', 'Later', 'Middle', 'Previous', 'Anomalous']

    test1 = year % 4
    test2 = year % 100
    test3 = year % 400

    if test2 == 0 and test3 != 0:
        year_type = types[4]
        index = 4
    else:
        year_type = types[test1]
        index = test1

    return year_type, index