{"task": {"agent_timeout": 600, "task": "1278", "verifier_timeout": 7200, "instruction": "Please implement a Python 3 solution to the below problem.\nReason through the problem and:\n1. Restate the problem in plain English\n2. Conceptualize a solution first in plain English\n3. Write a pseudocode solution\n4. Save your solution as solution.py\nNo outside libraries are allowed.\n\n[BEGIN PROBLEM]\n\nBessie is using the latest and greatest innovation in text-editing software,\nmiV! She starts with an input string consisting solely of upper and lowercase\nEnglish letters and wishes to transform it into some output string. With just\none keystroke, miV allows her to replace all occurrences of one English letter\n$c_1$ in the string with another English letter $c_2$. For example, given the\nstring $\\texttt{aAbBa}$, if Bessie selects $c_1$ as 'a' and $c_2$ as 'B', the given string transforms into\n$\\texttt{BAbBB}$.\n\nBessie is a busy cow, so for each of $T$ ($1\\le T\\le 10$) independent test\ncases, output the minimum number of keystrokes required to transform her input\nstring into her desired output string.\n\nINPUT FORMAT (input arrives from the terminal / stdin):\nThe first line contains $T$, the number of independent test cases.\n\nThe following $T$ pairs of lines contain an input and output string of equal\nlength.  All characters are upper or lowercase English letters (either A through\nZ or a through z). The sum of the lengths of all strings does not exceed $10^5$.\n\nOUTPUT FORMAT (print output to the terminal / stdout):\nFor each test case, output the minimum number of keystrokes required to change\nthe input string into the output string, or $-1$ if it is impossible to do so.\n\nSAMPLE INPUT:\n4\nabc\nabc\nBBC\nABC\nabc\nbbc\nABCD\nBACD\nSAMPLE OUTPUT: \n0\n-1\n1\n3\n\nThe first input string is the same as its output string, so no keystrokes are\nrequired.\n\nThe second input string cannot be changed into its output string because Bessie\ncannot change one '$\\texttt{B}$' to '$\\texttt{A}$' while keeping the other as\n'$\\texttt{B}$'.\n\nThe third input string can be changed into its output string by changing\n'$\\texttt{a}$' to '$\\texttt{b}$'.\n\nThe last input string can be changed into its output string like so:\n$\\texttt{ABCD} \\rightarrow \\texttt{EBCD} \\rightarrow \\texttt{EACD} \\rightarrow \\texttt{BACD}$.\n\nSCORING:\nInputs 2-6: Every string has a length at most $50$.Inputs 7-9: All strings consist only of lowercase letters '$\\texttt{a}$'\nthrough '$\\texttt{e}$'Inputs 10-15: No additional constraints.\n\n\nProblem credits: Benjamin Qi\n\n[END PROBLEM]\n", "memory": "2048m", "runnable": false, "difficulty": "medium", "language": "", "cpus": 1, "instruction_truncated": false, "category": "python_programming", "compose": false, "has_solution": true, "oracle": null, "docker_image": "", "taskset": "usaco", "tags": ["python", "programming", "usaco"]}, "runs": []}