#genocon2021b. [genocon2021_b]Practice 2

[genocon2021_b]Practice 2

Problem Statement

ss and tt are strings consisting of A, C, G, T. We denote ii-th characters of ss and tt by s\[i\] and t\[i\], respectively. We define the following score SsopS_{sop} and aim to maximize it by adding blank symbols to ss and tt at appropriate positions. Note that lengths of ss and tt after adding blank symbols should be the same, and NN denotes the length. A blank symbol is denoted by -.

SsopS_{sop} = sumi=1N\\sum_{i=1}^{N} sim(s\[i\], t\[i\])

sim(x,y)sim(x,y) is a function for calculating the similarity of xx and yy, and the following table defines its output.

xxyy

A

C

G

T

-

A

1

-3

-3

-3

-5

C

-3

1

-3

-3

-5

G

-3

-3

1

-3

-5

T

-3

-3

-3

1

-5

-

-5

-5

-5

-5

-5

For example when ss=CTCGGT and tt=CATCC, SsopS_{sop} is maximized if - is added right after the first character of ss, and is added twice right after the last character of tt.

SsopS_{sop} = sim(sim(C, C)+sim()+sim(-,A)+sim()+sim(T,T)+sim()+sim(C,C)+sim()+sim(G,C)+sim()+sim(G,-)+sim()+ sim(T,-)=1+(5)+1+1+(3)+(5)+(5)=15) = 1 + (-5) + 1 + 1 + (-3) + (-5) + (-5) = -15

Note that ss and tt with balnk symbols are aligned such that same character appears at same position in each string for many positions.

C-TCGGT
CATCC--

We call this task pairwise alignment and described it as strings in two lines.

Given two strings, output its pairwise alignment such that it maximizes SsopS_{sop}.

Constraints

  • ss and tt are strings consisting of A, C, G, T.
  • 10leqs,tleq40010 \\leq |s|, |t| \\leq 400 (length of a string xx is denoted by x|x|.)

Input

Input is given from Standard Input in the following format:

ss tt

Output

Print a pairwise alignment of input strings such that SsopS_{sop} is maximized. After inserting - in ss and tt,

ss should be printed in the first line, and tt should be printed in the second line. If there is more than one alignment that maximizes SsopS_{sop}, you can print any one of them.

The judging system can only accept user's output when: - The first line/second line is equal to the first line/second line of the input if - is removed. - The length of the first line is equal to that of the second line.


Sample Input 1

AGTTGAATTT
GTCGGACTTT

Sample Output 1

AGT-TGAATTT
-GTCGGACTTT