The top of the stack modulo k is greater than ( temp & k ) or if they are equal then compare the values
if ( ( tmpStackMod > tmpMod ) or ( tmpStackMod == tmpMod and tmpStack [ - 1 ] > tmp ) ) : NEW_LINE