字符串与渲染
题号:NC280356
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

\hspace{15pt}小歪有一个长度为 2 \times n 的字符串 s ,他想将字符串拆分为 n 个长度为 2 的子串,并使用 \LaTeX 格式将其渲染,具体地,我们可以按下面的语句描述整个过程(其中,尖括号仅用于代表标注位置,其本身不存在于语句中,其内的内容为子串的变量名)
\hspace{22.5pt}\bullet\将字符串 s 拆分为 n 个子串,记为 t_1,t_2,\dots,t_n
\hspace{22.5pt}\bullet\渲染下划线,使用 \texttt{\underline\{<···>\}} 语句,包裹奇数下标子串的第二位和偶数下标子串的第一位;得到 t_1',t_2',\dots,t_n'
~~~~~~~~~~~~\circ\例如,对于 t_1=\texttt{ ,由于其下标为奇数,所以包裹第二个字符 \tt B ,得到 t_1'=\texttt{
~~~~~~~~~~~~\circ\例如,对于 t_2=\texttt{ ,由于其下标为偶数,所以包裹第一个字符 \tt A ,得到 t_2'=\texttt{ ;
\hspace{22.5pt}\bullet\渲染颜色,对于第 i 个子串,读入色号 c_i,并使用 \texttt{\{\color\{<} c_i \texttt{>\}\{<} t_i' \texttt{>\}\}} 语句,包裹色号和子串;得到 t_1'',t_2'',\dots,t_n''
~~~~~~~~~~~~\circ\例如,对于 t_1'=\texttt{,读入色号 c_i=\tt \#ff0000 ,得到 t_1''=\texttt{\{\color\{#ff0000\}\{ ;
\hspace{22.5pt}\bullet\渲染数组,使用 \texttt{\{<} t_1'' \texttt{>,<} t_2'' \texttt{>,} \dots \texttt{,<} t_n'' \texttt{>\}} 语句渲染,并输出最终的答案。
\hspace{15pt}你只需要输出最终得到的 \LaTeX 语句即可。

\hspace{15pt}注意,虽然 \LaTeX 不同版本存在细微差别,但在本题中,请以上述步骤和示例为唯一准则。

输入描述:

\hspace{15pt}第一行输入一个整数 n\left(1 \leqq n \leqq 10^5 \right) 代表字符串的长度。
\hspace{15pt}第二行输入一个长度为 2 \times n ,且由数字、大小写字母混合构成的字符串 s 代表初始串。
\hspace{15pt}此后 n 行,每行输入一个以井号开头,七位长度的字符串(\sf HEX 色彩空间),代表色号。保证后六位仅由 \tt a\sim f 和数字构成。

输出描述:

\hspace{15pt}在一行上输出一个字符串,代表操作过后的字符串。
示例1

输入

复制
2
ABAB
#ff0000
#0000ff

输出

复制
{{\color{#ff0000}{"A\underline{B}"}},{\color{#0000ff}{"\underline{A}B"}}}

说明

\hspace{15pt}渲染可以得到 \tt{{\color{#ff0000}{ 。
示例2

输入

复制
6
CCiIAalLLloo
#f0908d
#ee827c
#d69090
#c97586
#b48a76
#a25768

输出

复制
{{\color{#f0908d}{"C\underline{C}"}},{\color{#ee827c}{"\underline{i}I"}},{\color{#d69090}{"A\underline{a}"}},{\color{#c97586}{"\underline{l}L"}},{\color{#b48a76}{"L\underline{l}"}},{\color{#a25768}{"\underline{o}o"}}}

说明

\hspace{15pt}渲染可以得到 \tt{{\color{#f0908d}{ 。