Buggy python submission (verdict: Runtime Error):
class UFTree():
  def __init__(self,n):
    self.N = n
    self.parent = {i:i for i in range(1,n+1)}
    
  def root(self,n):
    if self.parent[n]==n: return n
    else:
      self.parent[n] = self.root(self.parent[n])
      return self.parent[n]
      
  def unite(self,x,y):
    rx,ry = self.root(x), self.root(y)
    if rx>ry: rx,ry = ry,rx
    if rx!=ry: self.parent[rx] = ry
      
  def size(self,x):
    n = 0
    return sum([self.root(i+1)==x for i in range(self.N)])
  
N,M = map(int,input().split())
uft = UFTree(N)
for i in range(M):
  A,B = map(int,input().split())
  uft.unite(A,B)
print(max({i+1:uft.size(i+1) for i in range(N)}.values()))

Fixed submission:
class UFTree():
  def __init__(self,n):
    self.N = n
    self.parents = [-1]*n
    
  def root(self,n):
    if self.parents[n]<0: return n
    else:
      self.parents[n] = self.root(self.parents[n])
      return self.parents[n]
      
  def unite(self,x,y):
    rx,ry = self.root(x), self.root(y)
    if rx==ry: return
    if rx>ry: rx,ry = ry,rx
    self.parents[rx] += self.parents[ry]
    self.parents[ry] = rx
      
  def size(self,x):
    return -self.parents[self.root(x)]
  
N,M = map(int,input().split())
uft = UFTree(N)
for i in range(M):
  A,B = map(int,input().split())
  uft.unite(A-1,B-1)
print(max([uft.size(i) for i in range(N)]))

Buggy python submission (verdict: Runtime Error):
class UFTree():
  def __init__(self,n):
    self.parent = {i:i for i in range(1,n+1)}
    
  def root(self,n):
    if self.parent[n]==n: return n
    else: return self.root(self.parent[n])
      
  def unite(self,x,y):
    rx,ry = self.root(x), self.root(y)
    if rx!=ry: self.parent[rx] = ry
  
  def same(self,x,y):
    return self.root(x)==self.root(y)
  
N,M = map(int,input().split())
uft = UFTree(N)
for i in range(M):
  A,B = map(int,input().split())
  uft.unite(A,B)
  
ans = {i+1:0 for i in range(N)}
for i in range(N):
  ans[uft.root(i+1)]+=1
print(max(ans.values()))

Fixed submission:
class UFTree():
  def __init__(self,n):
    self.N = n
    self.parents = [-1]*n
    
  def root(self,n):
    if self.parents[n]<0: return n
    else:
      self.parents[n] = self.root(self.parents[n])
      return self.parents[n]
      
  def unite(self,x,y):
    rx,ry = self.root(x), self.root(y)
    if rx==ry: return
    if rx>ry: rx,ry = ry,rx
    self.parents[rx] += self.parents[ry]
    self.parents[ry] = rx
      
  def size(self,x):
    return -self.parents[self.root(x)]
  
N,M = map(int,input().split())
uft = UFTree(N)
for i in range(M):
  A,B = map(int,input().split())
  uft.unite(A-1,B-1)
print(max([uft.size(i) for i in range(N)]))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
Gs = []
for _ in range(M):
  AB = set(map(int,input().split()))
  for i,g in enumerate(Gs):
    if len(g&AB):
      Gs[i] = g|AB
      break
  else:
    Gs.append(AB)
print(max(map(len,Gs)))

Fixed submission:
class UFTree():
  def __init__(self,n):
    self.N = n
    self.parents = [-1]*n
    
  def root(self,n):
    if self.parents[n]<0: return n
    else:
      self.parents[n] = self.root(self.parents[n])
      return self.parents[n]
      
  def unite(self,x,y):
    rx,ry = self.root(x), self.root(y)
    if rx==ry: return
    if rx>ry: rx,ry = ry,rx
    self.parents[rx] += self.parents[ry]
    self.parents[ry] = rx
      
  def size(self,x):
    return -self.parents[self.root(x)]
  
N,M = map(int,input().split())
uft = UFTree(N)
for i in range(M):
  A,B = map(int,input().split())
  uft.unite(A-1,B-1)
print(max([uft.size(i) for i in range(N)]))