{"task": {"agent_timeout": 600, "task": "833", "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]\nFarmer John owns a family-run farm that has been passed down over several\ngenerations, with a herd of cows whose familial roots can similarly be traced\nback several generations on the same farm.  By examining old records, Farmer\nJohn is curious how the cows in his current herd are related to each-other.\nPlease help him in this endeavor!\n\nINPUT FORMAT:\nThe first line of input contains $N$ ($1 \\leq N \\leq 100$) followed by the names\nof two cows.  Cow names are each strings of at most 10 uppercase letters\n($A \\ldots Z$). Farmer John is curious about the relationship between the two\ncows on this line of input.  \n\nThe next $N$ lines each contain two cow names $X$ and $Y$, indicating that $X$\nis the mother of $Y$.  \n\nOUTPUT FORMAT:\nYou should print one line of output indicating the relationship between the two\ncows specified on the first line of input (for simplicity, let's call these two\ncows BESSIE and ELSIE for the examples below).  Here are the different types of\nrelationships that are possible:\nYou should output \"SIBLINGS\" if BESSIE and ELSIE have the same mother.BESSIE might be a direct descendant of ELSIE, meaning that ELSIE is either\nthe mother, grand-mother, great-grand-mother, great-great-grand-mother, etc., of\nBESSIE. If this is the case, you should print \"ELSIE is the (relation) of\nBESSIE\", where (relation) is the appropriate relationship, for example\n\"great-great-grand-mother\".If ELSIE is a child of an ancestor of\nBESSIE (and ELSIE is not herself an ancestor or sister of BESSIE), then ELSIE is BESSIE's aunt.\nYou should output \"ELSIE is the aunt of\nBESSIE\" if ELSIE is a child of BESSIE's grand-mother, \"ELSIE is the great-aunt\nof BESSIE\" if ELSIE is a child of BESSIE's great-grand-mother, \"ELSIE is the\ngreat-great-aunt of BESSIE\" if ELSIE is a child of BESSIE's\ngreat-great-grand-mother, and so on.If BESSIE and ELSIE are related by\nany other means (i.e., if they share a common ancestor), they are cousins, and\nyou should simply output \"COUSINS\".You should output \"NOT RELATED\" if\nBESSIE and ELSIE have no common ancestor, or neither is directly descended from\nthe other.\n\nThe following diagram helps illustrate the relationships above, which are the\nonly relationship types you need to consider.  Observe that \nsome relationships like \"niece\" (daughter of sister) are not necessary since if\nBESSIE is the niece of ELSIE, then ELSIE is BESSIE's aunt.\n\n\nSAMPLE INPUT:\n7 AA BB\nMOTHER AA\nGGMOTHER BB\nMOTHER SISTER\nGMOTHER MOTHER\nGMOTHER AUNT\nAUNT COUSIN\nGGMOTHER GMOTHER\nSAMPLE OUTPUT: \nBB is the great-aunt of AA\n\n\nProblem credits: Brian Dean\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": []}