Help me in solving VOTERS problem

My issue

why it is getting time limit exceed

My code

# cook your dish here
a,b,c=map(int,input().split())
l=[]
l1=list(set())
for _ in range(a+b+c):
    n=int(input())
    l.append(n)
l.sort()
for i in l:
    if i not in l1 and l.count(i)>=2:
        l1.append(i)
print(len(l1))
for i in l1:
    print(i)

Learning course: 1000 to 1400 difficulty problems
Problem Link: Discrepancies in the Voters List Practice Problem in - CodeChef

@siddu_410
plzz refer the following python code for debugging

N1,N2,N3=tuple(map(int,input().split(" ")))
data={}
lista=[]
for i in range(N1+N2+N3):
    si=int(input())
    if si not in data.keys():
        data[si]=1 
    else:
        data[si]+=1
for keys,values in data.items():
    if values>=2:
        lista.append(keys)
print(len(lista))
for i in (sorted(lista)):
    print(i)