Buggy python submission (verdict: Time Limit Exceeded):
#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

for _ in range(k):
    a,b=map(int,input().split())
    block[a].add(b)
    block[b].add(a)


checked=set([])
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.add(i)
        group=set([i])
        bf=set([i])
        while len(group)!= 0:
            temp=group.pop()
            for item in friend[temp]:
                if item not in checked:
                    checked.add(item)
                    group.add(item)
                    bf.add(item)
        lenbf=len(bf)
        for item1 in bf:
            bl=0
            for item2 in bf:
                if item2 in block[item1]:
                    bl+=1
            result[item1-1]=lenbf-1-len(list(friend[item1]))-bl



        bfbf.append(bf)
result=list(map(str,result))
print(" ".join(result))







Fixed submission:
#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
friendGroup=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)
    friendGroup.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

checked=set([])
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.add(i)
        group=set([i])
        bf=set([i])
        friendGroup[i-1]=i
        while len(group)!= 0:
            temp=group.pop()
            for item in friend[temp]:
                if item not in checked:
                    checked.add(item)
                    group.add(item)
                    bf.add(item)
                    friendGroup[item-1]=i
        lenbf=len(bf)
        for item1 in bf:
            result[item1-1]=lenbf-1-len(list(friend[item1]))

for _ in range(k):
    a,b=map(int,input().split())
    if friendGroup[a-1]!=0 and friendGroup[a-1]==friendGroup[b-1]:
        result[a-1]-=1
        result[b-1]-=1

result=list(map(str,result))
print(" ".join(result))

Buggy python submission (verdict: Time Limit Exceeded):

#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

for _ in range(k):
    a,b=map(int,input().split())
    block[a].add(b)
    block[b].add(a)


checked=set([])
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.add(i)
        group=[i]
        bf=[i]
        while len(group)!= 0:
            temp=group.pop(0)
            for item in friend[temp]:
                if item not in checked:
                    checked.add(item)
                    group.append(item)
                    bf.append(item)
        lenbf=len(bf)
        for item1 in bf:
            bl=0
            for item2 in bf:
                if item2 in block[item1]:
                    bl+=1
            result[item1-1]=lenbf-1-len(list(friend[item1]))-bl



        bfbf.append(bf)
result=list(map(str,result))
print(" ".join(result))







Fixed submission:
#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
friendGroup=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)
    friendGroup.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

checked=set([])
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.add(i)
        group=set([i])
        bf=set([i])
        friendGroup[i-1]=i
        while len(group)!= 0:
            temp=group.pop()
            for item in friend[temp]:
                if item not in checked:
                    checked.add(item)
                    group.add(item)
                    bf.add(item)
                    friendGroup[item-1]=i
        lenbf=len(bf)
        for item1 in bf:
            result[item1-1]=lenbf-1-len(list(friend[item1]))

for _ in range(k):
    a,b=map(int,input().split())
    if friendGroup[a-1]!=0 and friendGroup[a-1]==friendGroup[b-1]:
        result[a-1]-=1
        result[b-1]-=1

result=list(map(str,result))
print(" ".join(result))

Buggy python submission (verdict: Time Limit Exceeded):

#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

for _ in range(k):
    a,b=map(int,input().split())
    block[a].add(b)
    block[b].add(a)


checked=[]
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.append(i)
        group=[i]
        bf=[i]
        while len(group)!= 0:
            temp=group.pop(0)
            for item in friend[temp]:
                if item not in checked:
                    checked.append(item)
                    group.append(item)
                    bf.append(item)
        lenbf=len(bf)
        for item1 in bf:
            bl=0
            for item2 in bf:
                if item2 in block[item1]:
                    bl+=1
            result[item1-1]=lenbf-1-len(list(friend[item1]))-bl



        bfbf.append(bf)
result=list(map(str,result))
print(" ".join(result))







Fixed submission:
#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
friendGroup=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)
    friendGroup.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

checked=set([])
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.add(i)
        group=set([i])
        bf=set([i])
        friendGroup[i-1]=i
        while len(group)!= 0:
            temp=group.pop()
            for item in friend[temp]:
                if item not in checked:
                    checked.add(item)
                    group.add(item)
                    bf.add(item)
                    friendGroup[item-1]=i
        lenbf=len(bf)
        for item1 in bf:
            result[item1-1]=lenbf-1-len(list(friend[item1]))

for _ in range(k):
    a,b=map(int,input().split())
    if friendGroup[a-1]!=0 and friendGroup[a-1]==friendGroup[b-1]:
        result[a-1]-=1
        result[b-1]-=1

result=list(map(str,result))
print(" ".join(result))

Buggy python submission (verdict: Time Limit Exceeded):

#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

for _ in range(k):
    a,b=map(int,input().split())
    block[a].add(b)
    block[b].add(a)


checked=[]
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.append(i)
        group=[i]
        bf=[i]
        while len(group)!= 0:
            temp=group.pop(0)
            for item in friend[temp]:
                if item not in checked:
                    checked.append(item)
                    group.append(item)
                    bf.append(item)
        lenbf=len(bf)
        for item1 in bf:
            bl=0
            for item2 in bf:
                if item2 in block[item1]:
                    bl+=1
            result[item1-1]=lenbf-1-len(list(friend[item1]))-bl



        bfbf.append(bf)
result=list(map(str,result))
print(" ".join(result))







Fixed submission:
#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
friendGroup=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)
    friendGroup.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

checked=set([])
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.add(i)
        group=set([i])
        bf=set([i])
        friendGroup[i-1]=i
        while len(group)!= 0:
            temp=group.pop()
            for item in friend[temp]:
                if item not in checked:
                    checked.add(item)
                    group.add(item)
                    bf.add(item)
                    friendGroup[item-1]=i
        lenbf=len(bf)
        for item1 in bf:
            result[item1-1]=lenbf-1-len(list(friend[item1]))

for _ in range(k):
    a,b=map(int,input().split())
    if friendGroup[a-1]!=0 and friendGroup[a-1]==friendGroup[b-1]:
        result[a-1]-=1
        result[b-1]-=1

result=list(map(str,result))
print(" ".join(result))

Buggy python submission (verdict: Time Limit Exceeded):

#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

for _ in range(k):
    a,b=map(int,input().split())
    block[a].add(b)
    block[b].add(a)


checked=[]
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.append(i)
        group=[i]
        bf=[i]
        while len(group)!= 0:
            temp=group.pop(0)
            for item in friend[temp]:
                if item not in checked:
                    checked.append(item)
                    group.append(item)
                    bf.append(item)
        lenbf=len(bf)
        for item1 in bf:
            bl=0
            for item2 in bf:
                if item2 in block[item1]:
                    bl+=1
            result[item1-1]=lenbf-1-len(list(friend[item1]))-bl



        bfbf.append(bf)
result=list(map(str,result))
print(" ".join(result))







Fixed submission:
#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
friendGroup=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)
    friendGroup.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

checked=set([])
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.add(i)
        group=set([i])
        bf=set([i])
        friendGroup[i-1]=i
        while len(group)!= 0:
            temp=group.pop()
            for item in friend[temp]:
                if item not in checked:
                    checked.add(item)
                    group.add(item)
                    bf.add(item)
                    friendGroup[item-1]=i
        lenbf=len(bf)
        for item1 in bf:
            result[item1-1]=lenbf-1-len(list(friend[item1]))

for _ in range(k):
    a,b=map(int,input().split())
    if friendGroup[a-1]!=0 and friendGroup[a-1]==friendGroup[b-1]:
        result[a-1]-=1
        result[b-1]-=1

result=list(map(str,result))
print(" ".join(result))

Buggy python submission (verdict: Time Limit Exceeded):

#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

for _ in range(k):
    a,b=map(int,input().split())
    block[a].add(b)
    block[b].add(a)


checked=[]
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.append(i)
        group=[i]
        bf=[i]
        while len(group)!= 0:
            temp=group.pop(0)
            for item in friend[temp]:
                if item not in checked:
                    checked.append(item)
                    group.append(item)
                    bf.append(item)
        for item1 in bf:
            bl=0
            for item2 in bf:
                if item2 in block[item1]:
                    bl+=1
            result[item1-1]=len(bf)-1-len(list(friend[item1]))-bl



        bfbf.append(bf)
result=list(map(str,result))
print(" ".join(result))







Fixed submission:
#n:
#m:
#k:
n,m,k=map(int,input().split())
friend={}
block={}
result=[]
friendGroup=[]
for i in range(1,n+1):
    friend[i]=set([])
    block[i]=set([])
    result.append(0)
    friendGroup.append(0)

for _ in range(m):
    a,b=map(int,input().split())
    friend[a].add(b)
    friend[b].add(a)

checked=set([])
bfbf=[]
for i in range(1,n+1):
    #print(i,checked)
    if i not in checked:
        checked.add(i)
        group=set([i])
        bf=set([i])
        friendGroup[i-1]=i
        while len(group)!= 0:
            temp=group.pop()
            for item in friend[temp]:
                if item not in checked:
                    checked.add(item)
                    group.add(item)
                    bf.add(item)
                    friendGroup[item-1]=i
        lenbf=len(bf)
        for item1 in bf:
            result[item1-1]=lenbf-1-len(list(friend[item1]))

for _ in range(k):
    a,b=map(int,input().split())
    if friendGroup[a-1]!=0 and friendGroup[a-1]==friendGroup[b-1]:
        result[a-1]-=1
        result[b-1]-=1

result=list(map(str,result))
print(" ".join(result))