Used to avoid duplicates in result
arr = [ ] NEW_LINE for i in range ( min ( x , y ) + 1 ) : NEW_LINE INDENT pq = [ i , min ( x , y ) - i ] NEW_LINE arr . append ( pq ) NEW_LINE DEDENT for it in arr : NEW_LINE INDENT print ( it [ 0 ] , it [ 1 ] ) NEW_LINE DEDENT