as human erase history entirety as Bai Ze Hakutaku create history nothingnessPerfect Memento Strict SenseKeine ability manipulate history the history Gensokyo string s length 1 initially to fix chaos cause Yukari need follow operation n time ith time she choose nonempty substring t_2i1 s she replace t_2i1 nonempty string t_2i note length string t_2i1 t_2i differentnote t_2i1 occur s exactly replacedfor example let smarisa t_2i1a t_2iz after operation s mzrisa mariszAfter n operation Keine get final string operation sequence t length 2n just Keine think finished Yukari appear shuffle order t bad Keine forget initial history help Keine find initial history GensokyoRecall substre sequence consecutive character stre for example stre abc substrings ab c bc but follow string substre ac cba acbHacksYou hack problem