Performance of the CMS cathode strip chambers with cosmic rays