Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
import copy
import heapq
import math

from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    A_list = []
    input_raw = read_func().strip().split()
    for i in range(3* N):
        A_list.append(long(input_raw[i]))


    max_score = -sys.maxint
    L_min = sys.maxint
    R_max = -sys.maxint
    for i in range(N + 1):
       # if i == 0:
            AL_list = A_list[:N + i]
            AR_list = A_list[N + i:]
            AL_list = sorted(AL_list, reverse=True)
            AR_list = sorted(AR_list)
            L_sum = sum(AL_list[:N])
            R_sum = sum(AR_list[:N])
            max_score = max(max_score, (L_sum - R_sum))
            L_min = AL_list[0]
            R_min = AR_list[0]
##        else:
##            A = A_list[N + i]
##            if L_min < A:
##                L_sum = (L_sum - L_min) + A
##            if R_max > A:
##                R_sum = R_sum - A +
##
    print max_score


if __name__ == '__main__':
    main()

Fixed submission:
import sys
from collections import deque
import copy
import heapq
import math

from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    A_list = []
    input_raw = read_func().strip().split()
    for i in range(3* N):
        A_list.append(long(input_raw[i]))

    AL_list = A_list[:N]
    L_sum = [0 for i in range(N + 1)]
    L_sum[0] = sum(AL_list)
    heapq.heapify(AL_list)
    for i in range(N, 2 * N):
        if AL_list[0] < A_list[i]:
            heapq.heappush(AL_list, A_list[i])
            min_L = heapq.heappop(AL_list)
            L_sum[i + 1- N] = L_sum[i - N] - min_L + A_list[i]
        else:
            L_sum[i + 1- N] = L_sum[i - N]

    AR_list = [-A_list[i] for i in range(2 * N, 3 * N)]
    R_sum = [0 for i in range(N + 1)]
    R_sum[N] = sum(AR_list)
    heapq.heapify(AR_list)
    for i in range(2 * N - 1, N - 1, -1):
        if AR_list[0] < -A_list[i]:
            heapq.heappush(AR_list, -A_list[i])
            min_R = heapq.heappop(AR_list)
            R_sum[i - N] = R_sum[i - N + 1] - min_R + (-A_list[i])
        else:
            R_sum[i - N] = R_sum[i - N + 1]

    max_score = -long(sys.maxint * sys.maxint)
    for i in range(N + 1):
        max_score = max(max_score, L_sum[i] + R_sum[i])


##    for i in range(N + 1):
##        if i == 0:
##            AL_list = A_list[:N + i]
##            AR_list = A_list[N + i:]
##            AL_list = sorted(AL_list, reverse=True)
##            AR_list = sorted(AR_list)
##            L_sum = sum(AL_list[:N])
##            R_sum = sum(AR_list[:N])
##            max_score = max(max_score, (L_sum - R_sum))
##            L_min = AL_list[0]
##            R_min = AR_list[0]
##        else:
##            A = A_list[N + i]
##            if L_min < A:
##                L_index += 1
##                L_sum = (L_sum - L_min) + A
##                L_min(AL_list[L_index])
##            if R_max > A:
##                R_sum = R_sum - A +

    print max_score


if __name__ == '__main__':
    main()