Task prompt: Write a function in Python that takes two input strings, A and B, and returns the longest common subsequence (LCS) of A and B. A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements. For example, given the input strings "ABCDGH" and "AEDFHR", the LCS is "ADH".

Example input: ("ABCDGH", "AEDFHR")

Expected output: "ADH"