Square-1 solver by Shuang Chen.