Синцов заворочался и проснулся с той же мыслью, с какой заснул.
My humble knowledge of Russian grammar tells me that a declension of "который" should be used, instead of a declension of "какой";...