<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def residue_distances(res_1_num, res_1_chain, res_2_num, res_2_chain, model):
 """Distance between the last atom of 2 residues"""


    res1 = model[res_1_chain][res_1_num].child_list[-1]
    res2 = model[res_2_chain][res_2_num].child_list[-1]
    distance = res1 - res2

    return distance