A robot starts at (0, 0) facing north on an infinite 2D plane. It executes a command string s consisting of 'G' (move forward one unit), 'L' (turn left 90°), and 'R' (turn right 90°). After finishing s once, the robot repeats the same string k times, where k can be as large as 10^9. Implement an algorithm that (a) returns the robot’s final position and facing direction after one execution of s, and (b) determines whether the trajectory remains within a bounded region if s is repeated indefinitely. Provide time and space complexity and avoid simulating all k repetitions.