<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_details(fw, details, bed):
 """ Write per gene depth to file """

    for a, b, depth in details:
        for i in xrange(a, b):
            gi = bed[i].accn
            print("\t".join((gi, str(depth))), file=fw)