If starting points are equal
if ( Q == R ) { if ( tup [ i - 1 ] [ 1 ] < tup [ i ] [ 1 ] ) document . write ( tup [ i - 1 ] [ 2 ] + " " + tup [ i ] [ 2 ] ) ; else document . write ( tup [ i ] [ 2 ] + " " + tup [ i - 1 ] [ 2 ] ) ; return ; } let T = tup [ i ] [ 1 ] ;