slove it recursively, very good