def quarter_for_month(month):
    """return quarter for month"""
    if month not in range(1, 13):
        raise ValueError('invalid month')
    return {1: 1, 2: 1, 3: 1,
            4: 2, 5: 2, 6: 2,
            7: 3, 8: 3, 9: 3,
            10: 4, 11: 4, 12: 4}[month]
    # return (month + 2) // 3