def quadrant(fc1, fc2):
    """quadrant(fc1, fc2) -> 0..3

    Given the two different freeman codes fc1 and fc2, returns the
    number of the respective quadrant."""

    if fc2 < fc1:
        fc1, fc2 = fc2, fc1
    if fc1 > 0:
        return fc1
    if fc2 > 1:
        return 3
    return 0