But which takes precedent when there is a difference between them?
You'd have to give me a specific example of a conflict between the three. But certainly there exist, at the very least, apparent contradictions that require clarification.
So, from a logical perspective, the Church is the ultimate Authority since, without the Church to write, preserve and canonize Scripture, or to preserve and recognize Apostolic Tradition, the other two pillars of Christian teaching authority would be thrown into doubt.
We also have the words of Jesus.
If your brother or sister sins, go and point out their fault, just between the two of you. If they listen to you, you have won them over. But if they will not listen, take one or two others along, so that every matter may be established by the testimony of two or three witnesses. If they still refuse to listen, tell it to the church; and if they refuse to listen even to the church, treat them as you would a pagan or a tax collector.Keep in mind that Jesus could have said, "take it to Me." But he said, take it "to the church." So the Church must teach with equal Authority to that of Christ, even though the Church does not possess the entire Mind of Christ. But when the Church teaches definitively, It teaches with the Authority of Christ.
Other logical conclusions follow. Jesus could not have been speaking of an invisible church, since it's impossible for an invisible church to arbitrate disputes.
This church must also possess a unified, non-contradictory body of doctrine. Otherwise, It could not settle doctrinal disputes, such as, what constitutes a sin or "fault."