{"raw_statement":[{"iden":"statement","content":"Igor K. always used to trust his favorite Kashpirovsky Antivirus. That is why he didn't hesitate to download the link one of his groupmates sent him via QIP Infinium. The link was said to contain \"some real funny stuff about swine influenza\". The antivirus had no objections and Igor K. run the flash application he had downloaded. Immediately his QIP Infinium said: \"invalid login/password\".\n\nIgor K. entered the ISQ from his additional account and looked at the info of his main one. His name and surname changed to \"H1N1\" and \"Infected\" correspondingly, and the \"Additional Information\" field contained a strange-looking binary code 80 characters in length, consisting of zeroes and ones. \"I've been hacked\" — thought Igor K. and run the Internet Exploiter browser to quickly type his favourite search engine's address.\n\nSoon he learned that it really was a virus that changed ISQ users' passwords. Fortunately, he soon found out that the binary code was actually the encrypted password where each group of 10 characters stood for one decimal digit. Accordingly, the original password consisted of 8 decimal digits.\n\nHelp Igor K. restore his ISQ account by the encrypted password and encryption specification."},{"iden":"input","content":"The input data contains 11 lines. The first line represents the binary code 80 characters in length. That is the code written in Igor K.'s ISQ account's info. Next 10 lines contain pairwise distinct binary codes 10 characters in length, corresponding to numbers 0, 1, ..., 9."},{"iden":"output","content":"Print one line containing 8 characters — The password to Igor K.'s ISQ account. It is guaranteed that the solution exists."},{"iden":"examples","content":"Input\n\n01001100100101100000010110001001011001000101100110010110100001011010100101101100\n0100110000\n0100110010\n0101100000\n0101100010\n0101100100\n0101100110\n0101101000\n0101101010\n0101101100\n0101101110\n\nOutput\n\n12345678\n\nInput\n\n10101101111001000010100100011010101101110010110111011000100011011110010110001000\n1001000010\n1101111001\n1001000110\n1010110111\n0010110111\n1101001101\n1011000001\n1110010101\n1011011000\n0110001000\n\nOutput\n\n30234919"}],"translated_statement":[{"iden":"statement","content":"Igor K. 一直信任他最喜欢的 Kashpirovsky 杀毒软件。因此，当他收到一位同学通过 QIP Infinium 发来的链接时，他毫不犹豫地下载了。该链接声称包含\"关于猪流感的一些真正有趣的内容\"。杀毒软件没有提出任何异议，Igor K. 随即运行了他下载的 Flash 应用程序。立即，他的 QIP Infinium 显示：\"无效的登录名/密码\"。\n\nIgor K. 从他的备用账户登录 ISQ，查看了主账户的信息。他的姓名和姓氏分别被改为 \"H1N1\" 和 \"Infected\"，\"附加信息\" 字段包含一个长度为 #cf_span[80] 的奇怪二进制代码，由 0 和 1 组成。\"我被黑了\"——Igor K. 想道，于是他打开 Internet Exploiter 浏览器，迅速输入了他最喜欢的搜索引擎地址。\n\n很快，他了解到这确实是一种病毒，会更改 ISQ 用户的密码。幸运的是，他很快发现这个二进制代码实际上是加密后的密码，每 #cf_span[10] 个字符代表一个十进制数字。因此，原始密码由 #cf_span[8] 个十进制数字组成。\n\n请根据加密密码和加密规则，帮助 Igor K. 恢复他的 ISQ 账户。\n\n输入数据包含 #cf_span[11] 行。第一行是长度为 #cf_span[80] 的二进制代码，即写在 Igor K. 的 ISQ 账户信息中的代码。接下来的 #cf_span[10] 行包含两两不同的长度为 #cf_span[10] 的二进制代码，分别对应数字 0、1、...、9。\n\n请输出一行，包含 #cf_span[8] 个字符——Igor K. 的 ISQ 账户密码。保证解存在。"},{"iden":"input","content":"输入数据包含 #cf_span[11] 行。第一行是长度为 #cf_span[80] 的二进制代码，即写在 Igor K. 的 ISQ 账户信息中的代码。接下来的 #cf_span[10] 行包含两两不同的长度为 #cf_span[10] 的二进制代码，分别对应数字 0、1、...、9。"},{"iden":"output","content":"请输出一行，包含 #cf_span[8] 个字符——Igor K. 的 ISQ 账户密码。保证解存在。"},{"iden":"examples","content":"输入\n0100110010\n0101100000\n0101100010\n0101100100\n0101100110\n0101101000\n0101101010\n0101101100\n0100110000\n0100110010\n0101101110\n输出\n12345678\n\n输入\n1010110111\n1001000010\n1001000110\n1010110111\n0010110111\n0110001000\n1101111001\n0110001000\n1001000010\n1001000110\n1010011011\n输出\n30234919"}],"sample_group":[],"show_order":[],"formal_statement":"Given a binary string $ s $ of length 80, and 10 distinct binary strings $ b_0, b_1, \\dots, b_9 $, each of length 10, where $ b_i $ represents the encoding of decimal digit $ i $.\n\nLet $ s = s_0 s_1 \\dots s_{79} $.\n\nPartition $ s $ into 8 consecutive blocks of 10 characters each:\n$$\ns^{(k)} = s_{10k} s_{10k+1} \\dots s_{10k+9}, \\quad \\text{for } k = 0, 1, \\dots, 7.\n$$\n\nFor each block $ s^{(k)} $, find the unique digit $ d_k \\in \\{0,1,\\dots,9\\} $ such that $ s^{(k)} = b_{d_k} $.\n\nOutput the 8-digit string $ d_0 d_1 \\dots d_7 $.","simple_statement":null,"has_page_source":false}