In this task, you are given two strings A,B. You must perform the following operations to generate the required output list: (i) Find the longest common substring in the strings A and B, (ii) Convert this substring to all lowercase and sort it alphabetically, (iii) Replace the substring at its respective positions in the two lists with the updated substring.

Ex Input:
kiynTMFSRqqXC, ZBdYddMynTMFSRqqEDK

Ex Output:
kifmnqqrstyXC, ZBdYddMfmnqqrstyEDK


Ex Input:
emRSKsEqfIE, GonSKsERRP

Ex Output:
emRekssqfIE, GonekssRRP


Ex Input:
KzYaFLjXgtpYhALcy, FBaFLjXgtweBVNfg

Ex Output:

KzYafgjltxpYhALcy, FBafgjltxweBVNfg