If K is odd then print the path directly by choosing node 1 and 2 repeatedly
if ( K & 1 ) { document . write ( ` ` ) ; for ( let i = 1 ; i <= K + 1 ; i ++ ) { document . write ( ` ${ ( i & 1 ) + 1 } ` ) ; } return ; }