<span class="k">if</span> <span class="ow">not</span> <span class="n">T1</span> <span class="ow">or</span> <span
            class="ow">not</span> <span class="n">T1</span><span class="o">.</span><span class="n">root</span><span
            class="p">:</span>
        <span class="k">return</span> <span class="n">T2</span>

    <span class="n">first</span> <span class="o">=</span> <span class="n">T1</span><span class="o">.</span><span
            class="n">first</span>
    <span class="n">last</span> <span c