<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dateint_to_weekday(dateint, first_day='Monday'):
 """Returns the weekday of the given dateint. Arguments --------- dateint : int An integer object decipting a specific calendaric day; e.g. 20161225. first_day : str, default 'Monday' The first day of the week. Returns ------- int The weekday of the given dateint, when first day of the week = 0, last day of the week = 6. Example ------- 0 6 1 0 2 """

    weekday_ix = dateint_to_datetime(dateint).weekday()
    return (weekday_ix - WEEKDAYS.index(first_day)) % 7