def get_area_type(interval_1, interval_2, intervals_A, intervals_B):
    """
    Find what type of area was extracted from the Hi-C map.

    Parameters:
    interval_1 -- First interval used for extraction.
    interval_2 -- Second interval used for extraction.
    intervals_A -- List of compartment A intervals.
    intervals_B -- List of compartment B intervals.

    Output:
    Area type.
    """

    if (interval_1 in intervals_A and interval_2 in intervals_B) or\
       (interval_1 in intervals_B and interval_2 in intervals_A):
        return('AB')
    elif (interval_1 in intervals_A and interval_2 in intervals_A):
        return('A')
    elif (interval_1 in intervals_B and interval_2 in intervals_B):
        return('B')