rewrite ctci ch_1 and ch_2