Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:].extend(q[-y:]).extend(r)
z.sort()
print(sum(z[-x-y:]))

Fixed submission:
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:]
z.extend(q[-y:])
z.extend(r)
z.sort()
#print(z)
print(sum(z[-x-y:]))

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:].extend(q[-y:]).extend(r)
z.sort()
print(sum(z[-x-y]))

Fixed submission:
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:]
z.extend(q[-y:])
z.extend(r)
z.sort()
#print(z)
print(sum(z[-x-y:]))

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:].extend(q[-y:]).extend(r)
z.sort()
print(sum(z[-x-y]))

Fixed submission:
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:]
z.extend(q[-y:])
z.extend(r)
z.sort()
#print(z)
print(sum(z[-x-y:]))

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
r.sort()
ans = sum(p[-x:])+sum(q[-y:])
x_pos = -x
y_pos = -y
for i in range(c):
    #したから見ていく
    if min(p[x_pos],q[y_pos]) >= r[i]:
        continue
    elif p[x_pos] > q[y_pos]:
        ans += r[i] - q[y_pos]
        y_pos -= 1
    else:
        ans += r[i] - p[x_pos]
        x_pos -= 1
    if x_pos == -a:
        p.insert(0,10**5)
    if y_pos == -b:
        q.insert(0,10**5)
print(ans)


Fixed submission:
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:]
z.extend(q[-y:])
z.extend(r)
z.sort()
#print(z)
print(sum(z[-x-y:]))

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
r.sort()
ans = sum(p[-x:])+sum(q[-y:])
x_pos = -x
y_pos = -y
for i in range(c):
    #したから見ていく
    if min(p[x_pos],q[y_pos]) >= r[i]:
        continue
    elif p[x_pos] > q[y_pos]:
        ans += r[i] - q[y_pos]
        y_pos -= 1
    else:
        ans += r[i] - p[x_pos]
        x_pos -= 1
    if x_pos == -a:
        p.insert(0,10**5)
        x_pos -= 1
    if y_pos == -b:
        q.insert(0,10**5)
        y_pos -=1
print(ans)


Fixed submission:
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:]
z.extend(q[-y:])
z.extend(r)
z.sort()
#print(z)
print(sum(z[-x-y:]))

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
r.sort()
ans = sum(p[-x:])+sum(q[-y:])
x_pos = -x
y_pos = -y
for i in range(c):
    #したから見ていく
    if min(p[x_pos],q[y_pos]) >= r[i]:
        continue
    elif p[x_pos] > q[y_pos]:
        ans += r[i] - q[y_pos]
        y_pos -= 1
    else:
        ans += r[i] - p[x_pos]
        x_pos -= 1
print(ans)


Fixed submission:
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:]
z.extend(q[-y:])
z.extend(r)
z.sort()
#print(z)
print(sum(z[-x-y:]))