<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apmag_at_absmag(H, d, phi=1):
 """ Calculate the apparent magnitude of a TNO given its absolute magnitude H, for a given distance. :param H: TNO absolute magnitude (unitless) :param d: barycentric distance (AU) :param phi: phase angle (0-1, always v close to 1 for TNOs) :return: apparent magnitude of TNO """

    d_observer = 1.  # 1 AU
    # approximate object's distance d_heliocentric and d_geocentric as the same, d, because TNO
    m_r = H + 2.5 * math.log10((d ** 4) / (phi * d_observer ** 4))
    print("m_r = {:2.2f} for a H = {} TNO at {} AU at opposition.".format(
        m_r, H, d))
    return m_r