def daylight_saving(m, wd, d):
    """
    Assuming that DST start at last Sunday of March
    DST end at last Sunday of October

    Input:
    
    m: month, wd: week day, d: day of month are int() type
    month, week day and day of month count start from 1

    Output:

    1 if clock need to shift 1 hour forward
    -1 if clock need to shift 1 hour backward
    0 does not need to adjust clock
    """

    if m == 3:
        if wd == 7:
            if 31 >= d > 24:
                return 1

    elif m == 10:
        if wd == 7:
            if 31 >= d > 24:
                return -1

    else:
        return 0