Fire escape routee

hey,why am i getting runtime errror(NZEC) for this code.
class graph:
def init(self,n):
self.n=n
self.li=[[]for i in range(n)]
def addedge(self,u,v):
self.li[v].append(u)
self.li[u].append(v)
def __dfs(self,v,visited):
visited[v]=True
s=1
for i in range(len(self.li[v])):
if visited[self.li[v][i]] is False:
a=self.__dfs(self.li[v][i],visited)
s+=a
return s
def component(self):
visited=[False for i in range(self.n)]
count=0
ans=1
for i in range(self.n):
if visited[i] is False:
s=self.__dfs(i,visited)
ans=ans*s
count+=1
print(count%(10000000007),ans%(10000000007))
return
t=int(input())
for i in range(t):
n,m=map(int,input().split())
g=graph(n)
for i in range(m):
u,v=map(int,input().split())
g.addedge(u-1,v-1)
g.component()