Exact self-accelerating cosmologies in the ghost-free massive gravity: The detailed derivation