{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eGiven a dictionary of obscene words \u003cstrong\u003eS_1\u003c/strong\u003e , \u003cstrong\u003eS_2\u003c/strong\u003e , ..., \u003cstrong\u003eS_n\u003c/strong\u003e and text \u003cstrong\u003eT\u003c/strong\u003e, find if text contains one of obscene words as subsequence. If it does, find smallest prefix of \u003cstrong\u003eT\u003c/strong\u003e that contains such subsequence.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eInput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eFirst line of input contains one integer \u003cstrong\u003en\u003c/strong\u003e - number of words in dictionary. Following n lines contain words from dictionary, one per line. Each word consists of ASCII characters with codes from \u003cstrong\u003e32\u003c/strong\u003e to \u003cstrong\u003e127\u003c/strong\u003e, inclusive. Next line contains text \u003cstrong\u003eT\u003c/strong\u003e, consisting of the same set of characters. Total length of all words in dictionary doesn\u0027t exceed \u003cstrong\u003e100\u003c/strong\u003e KiB (\u003cstrong\u003e100\u003c/strong\u003e x \u003cstrong\u003e2^10\u003c/strong\u003e \u003cem\u003ebytes\u003c/em\u003e). Total size of input file doesn\u0027t exceed \u003cstrong\u003e1\u003c/strong\u003e MiB (\u003cstrong\u003e2^20\u003c/strong\u003e \u003cem\u003ebytes\u003c/em\u003e).\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eOutput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eOutput \u003cstrong\u003eNO\u003c/strong\u003e if there is no obscene subsequence in the text. Otherwise output \u003cstrong\u003eYES\u003c/strong\u003e \u003c\u003cstrong\u003eX\u003c/strong\u003e\u003e, where \u003cstrong\u003eX\u003c/strong\u003e is the length of smallest prefix of \u003cstrong\u003eT\u003c/strong\u003e that contains some obscene subsequence.\u003c/p\u003e\n\n"}},{"title":"Example","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\njsss\nbracd\nabracadabra\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES 7\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}