Fixed incorrect output caused by number swapping.