#K33377. String Interleaving

    ID: 25074 Type: Default 1000ms 256MiB

String Interleaving

String Interleaving

In this problem, you are given three strings: (s_1), (s_2), and (s_3). Your task is to determine whether (s_3) is an interleaving of (s_1) and (s_2). An interleaving of two strings (s_1) and (s_2) is a string that contains all the characters of (s_1) and (s_2) and preserves the left-to-right ordering of the characters from each string. Formally, if (s_1) has length (n) and (s_2) has length (m), then (s_3) must have length (n+m) and can be formed by inserting the characters of (s_2) into (s_1) without changing the order. If (s_3) is an interleaving, output (s_3); otherwise, output "Not Interleavable".

inputFormat

The input consists of three lines. The first line contains the string (s_1), the second line contains the string (s_2), and the third line contains the string (s_3).

outputFormat

Output a single line which is either (s_3) if it is a valid interleaving of (s_1) and (s_2), or the string "Not Interleavable" if it is not.## sample

abc
def
adbcef
adbcef