{"raw_statement":[{"iden":"statement","content":"After Fox Ciel got off a bus, she found that the bus she was on was a wrong bus and she lost her way in a strange town. However, she fortunately met her friend Beaver Taro and asked which way to go to her castle. Taro's response to her was a string _s_, and she tried to remember the string _s_ correctly.\n\nHowever, Ciel feels _n_ strings _b_1, _b_2, ... , _b__n_ are really boring, and unfortunately she dislikes to remember a string that contains a boring substring. To make the thing worse, what she can remember is only the contiguous substring of _s_.\n\nDetermine the longest contiguous substring of _s_ that does not contain any boring string, so that she can remember the longest part of Taro's response."},{"iden":"input","content":"In the first line there is a string _s_. The length of _s_ will be between 1 and 105, inclusive.\n\nIn the second line there is a single integer _n_ (1 ≤ _n_ ≤ 10). Next _n_ lines, there is a string _b__i_ (1 ≤ _i_ ≤ _n_). Each length of _b__i_ will be between 1 and 10, inclusive.\n\nEach character of the given strings will be either a English alphabet (both lowercase and uppercase) or a underscore (_'_'_) or a digit. Assume that these strings are case-sensitive."},{"iden":"output","content":"Output in the first line two space-separated integers _len_ and _pos_: the length of the longest contiguous substring of _s_ that does not contain any _b__i_, and the first position of the substring (0-indexed). The position _pos_ must be between 0 and |_s_| - _len_ inclusive, where |_s_| is the length of string _s_.\n\nIf there are several solutions, output any."},{"iden":"examples","content":"Input\n\nGo_straight_along_this_street\n5\nstr\nlong\ntree\nbiginteger\nellipse\n\nOutput\n\n12 4\n\nInput\n\nIhaveNoIdea\n9\nI\nh\na\nv\ne\nN\no\nI\nd\n\nOutput\n\n0 0\n\nInput\n\nunagioisii\n2\nioi\nunagi\n\nOutput\n\n5 5"},{"iden":"note","content":"In the first sample, the solution is _traight_alon_.\n\nIn the second sample, the solution is an empty string, so the output can be «_0 0_», «_0 1_», «_0 2_», and so on.\n\nIn the third sample, the solution is either _nagio_ or _oisii_."}],"translated_statement":[{"iden":"statement","content":"在狐狸Ciel下公交车后，她发现她乘坐的公交车坐错了，迷失在一个陌生的城镇中。然而，她幸运地遇到了她的朋友海狸Taro，并询问去她城堡的路。Taro对她的回应是一个字符串 #cf_span[s]，她试图正确记住这个字符串 #cf_span[s]。\n\n然而，Ciel觉得 #cf_span[n] 个字符串 #cf_span[b1, b2, ... , bn] 非常无聊，不幸的是，她不喜欢记住包含任何无聊子串的字符串。更糟糕的是，她只能记住 #cf_span[s] 的连续子串。\n\n请确定 #cf_span[s] 中最长的不包含任何无聊字符串的连续子串，以便她能记住Taro回应的最长部分。\n\n第一行包含一个字符串 #cf_span[s]。#cf_span[s] 的长度在 #cf_span[1] 到 #cf_span[105] 之间（包含两端）。\n\n第二行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 10]）。接下来的 #cf_span[n] 行，每行包含一个字符串 #cf_span[bi]（#cf_span[1 ≤ i ≤ n]）。每个 #cf_span[bi] 的长度在 #cf_span[1] 到 #cf_span[10] 之间（包含两端）。\n\n给定字符串中的每个字符均为英文字母（大小写均可）、下划线（_）或数字。假设这些字符串区分大小写。\n\n请在第一行输出两个用空格分隔的整数 #cf_span[len] 和 #cf_span[pos]：表示 #cf_span[s] 中最长的不包含任何 #cf_span[bi] 的连续子串的长度，以及该子串的起始位置（0索引）。位置 #cf_span[pos] 必须满足 #cf_span[0 ≤ pos ≤ |s| - len]，其中 #cf_span[|s|] 是字符串 #cf_span[s] 的长度。\n\n如果有多个解，输出任意一个即可。\n\n在第一个样例中，解为 _traight_alon_。\n\n在第二个样例中，解为空字符串，因此输出可以是 «_0 0_»、«_0 1_»、«_0 2_» 等等。\n\n在第三个样例中，解为 _nagio_ 或 _oisii_ 之一。"},{"iden":"input","content":"第一行包含一个字符串 #cf_span[s]。#cf_span[s] 的长度在 #cf_span[1] 到 #cf_span[105] 之间（包含两端）。第二行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 10]）。接下来的 #cf_span[n] 行，每行包含一个字符串 #cf_span[bi]（#cf_span[1 ≤ i ≤ n]）。每个 #cf_span[bi] 的长度在 #cf_span[1] 到 #cf_span[10] 之间（包含两端）。给定字符串中的每个字符均为英文字母（大小写均可）、下划线（_）或数字。假设这些字符串区分大小写。"},{"iden":"output","content":"请在第一行输出两个用空格分隔的整数 #cf_span[len] 和 #cf_span[pos]：表示 #cf_span[s] 中最长的不包含任何 #cf_span[bi] 的连续子串的长度，以及该子串的起始位置（0索引）。位置 #cf_span[pos] 必须满足 #cf_span[0 ≤ pos ≤ |s| - len]，其中 #cf_span[|s|] 是字符串 #cf_span[s] 的长度。如果有多个解，输出任意一个即可。"},{"iden":"examples","content":"输入\nGo_straight_along_this_street\n5\nstr\nlong\ntree\nbig\ninteger\nellipse\n输出\n12 4\n\n输入\nIhaveNoIdea\n9\nIhaveNoId\n输出\n0 0\n\n输入\nunagioisii\n2\nioi\nunagi\n输出\n5 5"},{"iden":"note","content":"在第一个样例中，解为 _traight_alon_。在第二个样例中，解为空字符串，因此输出可以是 «_0 0_»、«_0 1_»、«_0 2_» 等等。在第三个样例中，解为 _nagio_ 或 _oisii_ 之一。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ s \\in \\Sigma^* $ be the target string, where $ \\Sigma = \\{ \\text{a-z, A-Z, _, 0-9} \\} $.  \nLet $ B = \\{ b_1, b_2, \\dots, b_n \\} \\subseteq \\Sigma^* $ be the set of \"boring\" substrings, with $ n \\leq 10 $, and $ |b_i| \\leq 10 $ for all $ i $.  \n\n**Constraints**  \n1. $ 1 \\leq |s| \\leq 10^5 $  \n2. $ 1 \\leq n \\leq 10 $  \n3. $ 1 \\leq |b_i| \\leq 10 $ for all $ b_i \\in B $  \n4. All strings are case-sensitive.  \n\n**Objective**  \nFind a contiguous substring $ s[i:j] $ (with $ 0 \\leq i \\leq j \\leq |s| $) such that:  \n- $ s[i:j] $ contains **no** substring equal to any $ b_k \\in B $,  \n- $ j - i $ is maximized,  \n- Output the pair $ (\\text{len}, \\text{pos}) = (j - i, i) $.  \n\nIf multiple such substrings exist with maximum length, output any.","simple_statement":null,"has_page_source":false}