im guessing since your cat is up on the manifold you should put the smaller straight pipe up where the cat would be(im guessing) and then the next longer pipe, then the S pipe and then the pipe with the muffler attached to it. this was just off the top of my head and without the use of pictures, pictures would be better to help you.