Shinnen Algorithm