There may be several cases and each one has it’s own solution:

Case 1

Case 2

Case 3

Case 4