oder_list = input().split(';') codinate = [0,0] for item in oder_list: if not 2 <= len(item) <=3: continue try: direction = item[0] step = item[1:] if direction in ['A','W','D','S']: if 0 < int(step) <= 99: if direction == 'A': codinate[0] -=int(step) if direction == 'D': codinate[0] += ...