{"raw_statement":[{"iden":"statement","content":"You found a mysterious function _f_. The function takes two strings _s_1 and _s_2. These strings must consist only of lowercase English letters, and must be the same length.\n\nThe output of the function _f_ is another string of the same length. The _i_\\-th character of the output is equal to the minimum of the _i_\\-th character of _s_1 and the _i_\\-th character of _s_2.\n\nFor example, _f_(\"_ab_\", \"_ba_\") = \"_aa_\", and _f_(\"_nzwzl_\", \"_zizez_\") = \"_niwel_\".\n\nYou found two strings _x_ and _y_ of the same length and consisting of only lowercase English letters. Find any string _z_ such that _f_(_x_, _z_) = _y_, or print _\\-1_ if no such string _z_ exists."},{"iden":"input","content":"The first line of input contains the string _x_.\n\nThe second line of input contains the string _y_.\n\nBoth _x_ and _y_ consist only of lowercase English letters, _x_ and _y_ have same length and this length is between 1 and 100."},{"iden":"output","content":"If there is no string _z_ such that _f_(_x_, _z_) = _y_, print _\\-1_.\n\nOtherwise, print a string _z_ such that _f_(_x_, _z_) = _y_. If there are multiple possible answers, print any of them. The string _z_ should be the same length as _x_ and _y_ and consist only of lowercase English letters."},{"iden":"examples","content":"Input\n\nab\naa\n\nOutput\n\nba\n\nInput\n\nnzwzl\nniwel\n\nOutput\n\nxiyez\n\nInput\n\nab\nba\n\nOutput\n\n\\-1"},{"iden":"note","content":"The first case is from the statement.\n\nAnother solution for the second case is \"_zizez_\"\n\nThere is no solution for the third case. That is, there is no _z_ such that _f_(\"_ab_\", _z_) =  \"_ba_\"."}],"translated_statement":[{"iden":"statement","content":"你发现了一个神秘的函数 #cf_span[f]。该函数接受两个字符串 #cf_span[s1] 和 #cf_span[s2]。这些字符串必须仅由小写英文字母组成，且长度必须相同。\n\n函数 #cf_span[f] 的输出是另一个相同长度的字符串。输出的第 #cf_span[i] 个字符等于 #cf_span[s1] 的第 #cf_span[i] 个字符与 #cf_span[s2] 的第 #cf_span[i] 个字符中的最小值。\n\n例如，#cf_span[f(]\"_ab_\", \"_ba_\"#cf_span[)] = \"_aa_\"，且 #cf_span[f(]\"_nzwzl_\", \"_zizez_\"#cf_span[)] = \"_niwel_\"。\n\n你找到了两个长度相同且仅由小写英文字母组成的字符串 #cf_span[x] 和 #cf_span[y]。请找出任意一个字符串 #cf_span[z]，使得 #cf_span[f(x, z) = y]；如果不存在这样的字符串 #cf_span[z]，则输出 _-1_。\n\n输入的第一行包含字符串 #cf_span[x]。\n\n输入的第二行包含字符串 #cf_span[y]。\n\n#cf_span[x] 和 #cf_span[y] 均仅由小写英文字母组成，且长度相同，长度介于 #cf_span[1] 和 #cf_span[100] 之间。\n\n如果不存在满足 #cf_span[f(x, z) = y] 的字符串 #cf_span[z]，请输出 _-1_。\n\n否则，请输出一个满足 #cf_span[f(x, z) = y] 的字符串 #cf_span[z]。如果有多个可能的答案，请输出任意一个。字符串 #cf_span[z] 应与 #cf_span[x] 和 #cf_span[y] 长度相同，且仅由小写英文字母组成。\n\n第一个样例来自题面。\n\n第二个样例的另一个解是 \"_zizez_\"。\n\n第三个样例无解。即，不存在 #cf_span[z] 使得 #cf_span[f(]\"_ab_\", #cf_span[z) = ] \"_ba_\"。\n\n"},{"iden":"input","content":"输入的第一行包含字符串 #cf_span[x]。输入的第二行包含字符串 #cf_span[y]。#cf_span[x] 和 #cf_span[y] 均仅由小写英文字母组成，且长度相同，长度介于 #cf_span[1] 和 #cf_span[100] 之间。"},{"iden":"output","content":"如果不存在满足 #cf_span[f(x, z) = y] 的字符串 #cf_span[z]，请输出 _-1_。否则，请输出一个满足 #cf_span[f(x, z) = y] 的字符串 #cf_span[z]。如果有多个可能的答案，请输出任意一个。字符串 #cf_span[z] 应与 #cf_span[x] 和 #cf_span[y] 长度相同，且仅由小写英文字母组成。"},{"iden":"examples","content":"输入\nab\naa\n输出\nba\n输入\nnzwzl\nniwel\n输出\nxiyez\n输入\nab\nba\n输出\n-1"},{"iden":"note","content":"第一个样例来自题面。第二个样例的另一个解是 \"_zizez_\"。第三个样例无解。即，不存在 #cf_span[z] 使得 #cf_span[f(]\"_ab_\", #cf_span[z) = ] \"_ba_\"。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ x, y \\in \\Sigma^n $ be strings of length $ n $, where $ \\Sigma = \\{a, b, \\dots, z\\} $ is the set of lowercase English letters.  \nDefine the function $ f: \\Sigma^n \\times \\Sigma^n \\to \\Sigma^n $ such that for all $ i \\in \\{1, \\dots, n\\} $:  \n$$\nf(x, z)_i = \\min(x_i, z_i)\n$$  \nwhere $ \\min $ is the lexicographic minimum (i.e., character with smaller ASCII value).\n\n**Constraints**  \n1. $ 1 \\le n \\le 100 $  \n2. $ x_i, y_i \\in \\Sigma $ for all $ i \\in \\{1, \\dots, n\\} $\n\n**Objective**  \nFind a string $ z \\in \\Sigma^n $ such that for all $ i \\in \\{1, \\dots, n\\} $:  \n$$\n\\min(x_i, z_i) = y_i\n$$  \nIf no such $ z $ exists, output $-1$.","simple_statement":null,"has_page_source":false}