def ZellerDayOfWeek(input_date):
    """Uses Zeller's congruence (Gregorian) to return the day of week.
    Returns 0 for Saturday, 1 for Sunday, .... 6 for Friday"""
    date = [0,0,0]
    date[0] = input_date[0]
    date[1] = input_date[1]
    date[2] = input_date[2]
    if date[1] == 1 or date[1] == 2:
        date[1] += 12
        date[0] -= 1
    q = date[2] #day of month
    m = date[1] #month
    K = date[0] % 100 #year of century (year % 100)
    J = date[0] // 100 #century (19 for 19xx, etc)
    my_sum = q
    my_sum += ((13 * (m + 1)) // 5)
    my_sum += K
    my_sum += (K // 4)
    my_sum += (J // 4)
    my_sum += 5 * J
    return my_sum % 7