{"task": {"agent_timeout": 600, "task": "1109", "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]\nThe fence surrounding Farmer John's largest pasture has fallen into disrepair,\nand he has finally decided to replace it with a new fence.  \n\nUnfortunately, as Farmer John is laying out the new fence, a large bee ends up\nchasing him around the pasture, and as a result, the fence ends up following a\nrather irregular path.  The fence can be described by a string of characters,\neach either \"N\" (north), \"E\" (east), \"S\" (south),  or \"W\" (west).  Each\ncharacter describes a 1-meter run of the fence.  For example, if the string is\nNESW, this means the fence starts by moving north for 1 meter, then east for 1\nmeter, then south for 1 meter, then west for  1 meter, returning to its starting\npoint.  \n\nThe fence ends at the position where it started, and this is the only point\nvisited more than once by the path of the fence (and the starting point is only\nre-visited once, at the end).  As a result, the fence does indeed enclose a\nsingle connected region of the grassy pasture, even though this region could\nhave a rather strange shape.  \n\nFarmer John is curious if the path in which he laid the fence traveled clockwise\n(with the enclosed region on the right side of the fence as one walks along the\npath of the fence in the order specified by the string) or counter-clockwise\n(with the enclosed region on the left side of the fence).  \n\nINPUT FORMAT (input arrives from the terminal / stdin):\nThe first line of input contains an integer $N$ ($1 \\leq N \\leq 20$).  Each  of\nthe next $N$ lines contains a string of length at least 4 and at most 100,\ndescribing a single fence path.\n\nOUTPUT FORMAT (print output to the terminal / stdout):\nFor each of the $N$ fence paths described in the input, output a line containing\neither \"CW\" (clockwise) or \"CCW\" (counterclockwise).\n\nSAMPLE INPUT:\n2\nNESW\nWSSSEENWNEESSENNNNWWWS\nSAMPLE OUTPUT: \nCW\nCCW\n\nThe two fence paths with @ denoting the starting point:\n\n\n*>*\n^ v\n@<*\n\n  *<*<*<*\n  v     ^\n*<@     *\nv       ^\n* *>*>* *\nv ^   v ^\n* *<* * *\nv   ^ v ^\n*>*>* *>*\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": []}