Appleman Toastman like game today play game string follow rule Firstly Toastman tell Appleman string s t consist letter a b c d then Appleman build string s quickly possible initially string second append end current string contiguous substre tNow Toastman Appleman begin play game Toastman tell string t Appleman have not come stre s toastman think choose string s consist n character of course wants find bad string Appleman string Appleman spend time possible game Tell Toastman time Appleman spend game Toastman find bad string you assume Appleman play optimally build string s minimal possible time