There is no special trick. You print a random instruction of length 100000, and if you are lucky enough your answer might get AC. Else try resubmitting a few more times to increase the chances of getting AC. There are few solutions, looking at whom you would get an idea of how to solve using random string method. The links to the solutions are as follows:
I agree with @prakhariitd and strictly recommend to solve it using proper approach (i.e. bfs + greedy).