#K8811. Robotic Vacuum Cleaner Navigation

    ID: 37236 Type: Default 1000ms 256MiB

Robotic Vacuum Cleaner Navigation

Robotic Vacuum Cleaner Navigation

A robotic vacuum cleaner starts at the origin \( (0, 0) \) on a 2D plane. It receives a series of commands that dictate its movements. Each command is one of the following: UP, DOWN, LEFT, or RIGHT. The vacuum follows these commands sequentially. For every command:

\( \begin{aligned} \text{if command = 'UP'} &:\ y \gets y + 1 \\ \text{if command = 'DOWN'} &:\ y \gets y - 1 \\ \text{if command = 'LEFT'} &:\ x \gets x - 1 \\ \text{if command = 'RIGHT'} &:\ x \gets x + 1 \end{aligned} \)

Your task is to compute the final position \( (x, y) \) of the vacuum after it executes all commands. This problem tests simple simulation and string processing skills.

inputFormat

The input is provided via standard input (stdin). The first line contains an integer \( n \), which represents the number of commands. The next \( n \) lines each contain one command: UP, DOWN, LEFT, or RIGHT.

outputFormat

Output the final \( x \) and \( y \) coordinates of the vacuum on a single line, separated by a space. The output is sent to standard output (stdout).

## sample
0
0 0

</p>