I can't actually think of a way of helping you without giving the answer. Let me try it this way: given q_i and q_j with i<j it is rather clear that there is an integer combination of them that is 1, that is there are integeres a and b with aq_i +bq_j =1 (and hence they are coprime). You have acutally written these integers a and b out explicitly in your own post.