Did you know that the participle requires the same case and preposition as the verb it was formed from?
Сидеть на диване – сидящий на диване. To sit on the sofa. The one sitting on the sofa. Prepositional case.
Писать книгу – писавший книгу. To write a book. The one who was writing a book. Accusative case.