If Someone hit car behind you and that car hit you who pays?

I'm pretty sure the first car that hits and starts the accident pays.