def roll_rating(flight_phase, aircraft_class, roll_timecst):
    """ Give a rating of the Roll mode : Level1 Level2 or Level 3 according to MILF-8785C
    Args:
        flight_phase : string : 'A',  'B' or 'C'
        aircraft_class : int :  1, 2, 3 or 4
        roll_timecst (float): Roll Mode time constante [s]

    Returns:
        1 one 2 or 3 corresponding to the flight level
    """
    if flight_phase == 'A' or flight_phase == 'C':
        if aircraft_class ==1 or aircraft_class == 4:
            if 0<= roll_timecst <=1:
                roll_rate = 1
            elif roll_timecst <=1.4:
                roll_rate = 2
            elif roll_timecst <= 10:
                roll_rate = 3
            else:
                roll_rate =  None
        else: # aircraft_class == 2 or aircraft_class == 3:
            if 0<= roll_timecst <=1.4:
                roll_rate = 1
            elif roll_timecst <=3:
                roll_rate = 2
            elif roll_timecst <= 10:
                roll_rate = 3
            else:
                roll_rate =  None
    else: #  flight_phase == 'B':
        if 0<= roll_timecst <=1.4:
            roll_rate = 1
        elif roll_timecst <=3:
            roll_rate = 2
        elif roll_timecst <= 10:
            roll_rate = 3
        else:
            roll_rate =  None

    return roll_rate