{"problem":{"name":"Go Straight and Turn Right","description":{"content":"Consider an $xy$\\-plane. The positive direction of the $x$\\-axis is in the direction of east, and the positive direction of the $y$\\-axis is in the direction of north.   Takahashi is initially at poin","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc244_b"},"statements":[{"statement_type":"Markdown","content":"Consider an $xy$\\-plane. The positive direction of the $x$\\-axis is in the direction of east, and the positive direction of the $y$\\-axis is in the direction of north.  \nTakahashi is initially at point $(x, y) = (0, 0)$ and facing east (in the positive direction of the $x$\\-axis).\nYou are given a string $T = t_1t_2\\ldots t_N$ of length $N$ consisting of `S` and `R`. Takahashi will do the following move for each $i = 1, 2, \\ldots, N$ in this order.\n\n*   If $t_i =$ `S`, Takahashi advances in the current direction by distance $1$.\n*   If $t_i =$ `R`, Takahashi turns $90$ degrees clockwise without changing his position. As a result, Takahashi's direction changes as follows.\n    *   If he is facing east (in the positive direction of the $x$\\-axis) before he turns, he will face south (in the negative direction of the $y$\\-axis) after he turns.\n    *   If he is facing south (in the negative direction of the $y$\\-axis) before he turns, he will face west (in the negative direction of the $x$\\-axis) after he turns.\n    *   If he is facing west (in the negative direction of the $x$\\-axis) before he turns, he will face north (in the positive direction of the $y$\\-axis) after he turns.\n    *   If he is facing north (in the positive direction of the $y$\\-axis) before he turns, he will face east (in the positive direction of the $x$\\-axis) after he turns.\n\nPrint the coordinates Takahashi is at after all the steps above have been done.\n\n## Constraints\n\n*   $1 \\leq N \\leq 10^5$\n*   $N$ is an integer.\n*   $T$ is a string of length $N$ consisting of `S` and `R`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$T$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc244_b","tags":[],"sample_group":[["4\nSSRS","2 -1\n\nTakahashi is initially at $(0, 0)$ facing east. Then, he moves as follows.\n\n1.  $t_1 =$ `S`, so he advances in the direction of east by distance $1$, arriving at $(1, 0)$.\n2.  $t_2 =$ `S`, so he advances in the direction of east by distance $1$, arriving at $(2, 0)$.\n3.  $t_3 =$ `R`, so he turns $90$ degrees clockwise, resulting in facing south.\n4.  $t_4 =$ `S`, so he advances in the direction of south by distance $1$, arriving at $(2, -1)$.\n\nThus, Takahashi's final position, $(x, y) = (2, -1)$, should be printed."],["20\nSRSRSSRSSSRSRRRRRSRR","0 1"]],"created_at":"2026-03-03 11:01:14"}}