E2. Amanojaku and Sequence (Hard Version) Hints: Amanojaku and Sequence (Hard Version) Code: Amanojaku and Sequence (Hard Version)