Buggy python submission (verdict: Runtime Error):
#heapqすら使わなくても良い
x,y,a,b,c=map(int,input().split())
def _int(x):
    return -int(x)
p=sorted(list(map(_int,input().split())),reverse=True)[:x]
q=sorted(list(map(_int,input().split())),reverse=True)[:y]
r=sorted(list(map(_int,input().split())),reverse=True)

p.extend(q)
ans=sorted(p)

#ansは小さい順、rは大きい順
for i in range(x+y):
    if len(r)==0:break
    if r[i]>=ans[i]:
        ans[i]=r[i]
    else:
        break
print(sum(ans))

Fixed submission:
import heapq
x,y,a,b,c=map(int,input().split())
def _int(x):
    return -int(x)
p=list(map(_int,input().split()))
q=list(map(_int,input().split()))
r=list(map(_int,input().split()))
heapq.heapify(p)
heapq.heapify(q)
heapq.heapify(r)

ans=[]
heapq.heapify(ans)
for i in range(x):
    _p=heapq.heappop(p)
    heapq.heappush(ans,-_p)
for i in range(y):
    _q=heapq.heappop(q)
    heapq.heappush(ans,-_q)
#ansは小さい順、rは大きい順
for i in range(x+y):
    if len(r)==0:break
    _ans=heapq.heappop(ans)
    _r=-heapq.heappop(r)
    if _r>=_ans:
        heapq.heappush(ans,_r)
    else:
        heapq.heappush(ans,_ans)
        break
print(sum(ans))

Buggy python submission (verdict: Runtime Error):
import heapq
x,y,a,b,c=map(int,input().split())
def _int(x):
    return -int(x)
p=list(map(_int,input().split()))
q=list(map(_int,input().split()))
r=list(map(_int,input().split()))
heapq.heapify(p)
heapq.heapify(q)
heapq.heapify(r)
ans=0
for i in range(x):
    if len(r)==0:
        _p=heapq.heappop(p)
        ans-=_p
        continue
    _p,_r=heapq.heappop(p),heapq.heappop(r)
    if _p<_r:
        ans-=_p
        heapq.heappush(r,_r)
    else:
        ans-=_r
        heapq.heappush(p,_p)
for i in range(y):
    if len(r)==0:
        _q=heapq.heappop(q)
        ans-=_q
    _q,_r=heapq.heappop(q),heapq.heappop(r)
    if _q<_r:
        ans-=_q
        heapq.heappush(r,_r)
    else:
        ans-=_r
        heapq.heappush(q,_q)
print(ans)
    


Fixed submission:
import heapq
x,y,a,b,c=map(int,input().split())
def _int(x):
    return -int(x)
p=list(map(_int,input().split()))
q=list(map(_int,input().split()))
r=list(map(_int,input().split()))
heapq.heapify(p)
heapq.heapify(q)
heapq.heapify(r)

ans=[]
heapq.heapify(ans)
for i in range(x):
    _p=heapq.heappop(p)
    heapq.heappush(ans,-_p)
for i in range(y):
    _q=heapq.heappop(q)
    heapq.heappush(ans,-_q)
#ansは小さい順、rは大きい順
for i in range(x+y):
    if len(r)==0:break
    _ans=heapq.heappop(ans)
    _r=-heapq.heappop(r)
    if _r>=_ans:
        heapq.heappush(ans,_r)
    else:
        heapq.heappush(ans,_ans)
        break
print(sum(ans))

Buggy python submission (verdict: Runtime Error):
import heapq
x,y,a,b,c=map(int,input().split())
def _int(x):
    return -int(x)
p=list(map(_int,input().split()))
q=list(map(_int,input().split()))
r=list(map(_int,input().split()))
heapq.heapify(p)
heapq.heapify(q)
heapq.heapify(r)
ans=0
for i in range(x):
    _p,_r=heapq.heappop(p),heapq.heappop(r)
    if _p<_r:
        ans-=_p
        heapq.heappush(r,_r)
    else:
        ans-=_r
        heapq.heappush(p,_p)
for i in range(y):
    _q,_r=heapq.heappop(q),heapq.heappop(r)
    if _q<_r:
        ans-=_q
        heapq.heappush(r,_r)
    else:
        ans-=_r
        heapq.heappush(q,_q)
print(ans)
    


Fixed submission:
import heapq
x,y,a,b,c=map(int,input().split())
def _int(x):
    return -int(x)
p=list(map(_int,input().split()))
q=list(map(_int,input().split()))
r=list(map(_int,input().split()))
heapq.heapify(p)
heapq.heapify(q)
heapq.heapify(r)

ans=[]
heapq.heapify(ans)
for i in range(x):
    _p=heapq.heappop(p)
    heapq.heappush(ans,-_p)
for i in range(y):
    _q=heapq.heappop(q)
    heapq.heappush(ans,-_q)
#ansは小さい順、rは大きい順
for i in range(x+y):
    if len(r)==0:break
    _ans=heapq.heappop(ans)
    _r=-heapq.heappop(r)
    if _r>=_ans:
        heapq.heappush(ans,_r)
    else:
        heapq.heappush(ans,_ans)
        break
print(sum(ans))