you give array path pathsi cityAi cityBi mean exist direct path go cityAi cityBi Return destination city city path outgoing cityit guarantee graph path form line loop exactly destination city example 1input path LondonNew YorkNew YorkLimaLimaSao PauloOutput Sao Paulo Explanation Starting London city reach Sao Paulo city destination city your trip consist London New York Lima Sao PauloExample 2input path bcdbcaoutput AExplanation all possible trip D b C a b c a c a a clearly destination city AExample 3input path AZOutput Z Constraints1 pathslength 100pathsilength 21 cityAilength citybilength 10cityAi cityBiAll string consist lowercase uppercase English letter space character