#NEWLINE# def popmin( a , b ) : #NEWLINE# #INDENT# "\n    popmin(a, b) -> (i, a', b')\n\n    where i is min(a[0], b[0]) and a'/b' are the results of removing i from the\n    relevant sequence.\n    " #NEWLINE# if ( len ( a ) == 0 ) : #NEWLINE# #INDENT# return ( b [ 0 ] , a , b [ 1 : ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( b ) == 0 ) : #NEWLINE# #INDENT# return ( a [ 0 ] , a [ 1 : ] , b ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( a [ 0 ] > b [ 0 ] ) : #NEWLINE# #INDENT# return ( b [ 0 ] , a , b [ 1 : ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( a [ 0 ] , a [ 1 : ] , b )