mergeString(s1, s2) that takes two strings and returns the merged string with s2 appended to s1 at the point where s2's prefix matches s1's suffix the most.f(A, B, C) that merges strings A, B, and C using the mergeString function.finalAns with a string of maximum possible length (e.g., 'a' * 301).a, b, and c, and for each permutation, use the f function to merge the strings.finalAns with the current merged string if it is shorter than the previous finalAns, or if it is the same length but lexicographically smaller.finalAns as the result.