대놓고 bfs import sys input = sys.stdin.readline from collections import deque def bfs(start): visited[start] = True q = deque() q.append([start,'']) while q: cur_register, commands = q.popleft() if cur_register==target: return commands for command in 'DSLR': if command=='D': next_register = (cur_register*2)%10000 elif command=='S': next_register = (cur_register-1)%10000 elif command=='L': next_reg..