Buggy python submission (verdict: Runtime Error):
from collections import Counter

class UnionFind:
    def __init__(self,num:int):
        self.r = [-1 for i in range(num)]
    def root(self,x:int):
        if(self.r[x] < 0):
            return x
        self.r[x] = self.root(self.r[x])
        return self.r[x]
    def unite(self,x:int,y:int):
        rx = self.root(x)
        ry = self.root(y)
        if(rx == ry):
            return False
        if(self.r[x] > self.r[y]):
            x,y = y,x
        self.r[x] += self.r[y]
        self.r[y] = x
        return True
    def size(self,x:int):
        return -self.r[self.root(x)]

N,M = map(int,input().split())
group = UnionFind(N)
ans = 0
for i in range(M):
    A,B = map(int,input().split())
    group.unite(A-1,B-1)
ans = 0
for i in range(N):
    ans = max(ans,group.size(i))
print(ans)


Fixed submission:
from collections import Counter

class UnionFind:
    def __init__(self,num:int):
        self.r = [-1 for i in range(num)]
    def root(self,x:int):
        if(self.r[x] < 0):
            return x
        self.r[x] = self.root(self.r[x])
        return self.r[x]
    def unite(self,x:int,y:int):
        rx = self.root(x)
        ry = self.root(y)
        if(rx == ry):
            return False
        if(self.r[rx] > self.r[ry]):
            rx,ry = ry,rx
        self.r[rx] += self.r[ry]
        self.r[ry] = rx
        return True
    def size(self,x:int):
        return -self.r[self.root(x)]

N,M = map(int,input().split())
group = UnionFind(N)
for i in range(M):
    A,B = map(int,input().split())
    group.unite(A-1,B-1)
ans = 0
for i in range(N):
    ans = max(ans,group.size(i))
print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import Counter

class UnionFind:
    def __init__(self,num:int):
        self.parents = [i for i in range(num)]
    def root(self,x:int):
        if(self.parents[x] == x):
            return x
        return self.root(self.parents[x])
    def unite(self,x:int,y:int):
        rx = self.root(x)
        ry = self.root(y)
        if(rx == ry):
            return
        self.parents[rx] = ry
    def same(self,x:int,y:int):
        rx = root(x)
        ry = root(y)
        return rx == ry

N,M = map(int,input().split())
group = UnionFind(N)
ans = 0
for i in range(M):
    A,B = map(int,input().split())
    group.unite(A-1,B-1)
a = [group.root(i) for i in range(N)]
ans = Counter(a)
print(ans.most_common()[0][1])


Fixed submission:
from collections import Counter

class UnionFind:
    def __init__(self,num:int):
        self.r = [-1 for i in range(num)]
    def root(self,x:int):
        if(self.r[x] < 0):
            return x
        self.r[x] = self.root(self.r[x])
        return self.r[x]
    def unite(self,x:int,y:int):
        rx = self.root(x)
        ry = self.root(y)
        if(rx == ry):
            return False
        if(self.r[rx] > self.r[ry]):
            rx,ry = ry,rx
        self.r[rx] += self.r[ry]
        self.r[ry] = rx
        return True
    def size(self,x:int):
        return -self.r[self.root(x)]

N,M = map(int,input().split())
group = UnionFind(N)
for i in range(M):
    A,B = map(int,input().split())
    group.unite(A-1,B-1)
ans = 0
for i in range(N):
    ans = max(ans,group.size(i))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
"""
N = int(input())
A = list(map(int,input().split()))
ans = 0
mod = 1000000007

for i in range(N-1):
    for j in range(i+1,N):
        ans += A[i]*A[j]
        ans = ans%mod
print(ans)
"""
from collections import deque

N,M = map(int,input().split())
MAP = [[False for x in range(N+1)] for x in range(N+1)]
ans = 0
for i in range(M):
    A,B = map(int,input().split())
    MAP[A][B]=True
    MAP[B][A]=True
LIST = list(range(1,N+1))

while(True):
    if(LIST != []):
        group = set()
        group.add(LIST[0])
        q = deque()
        q.append(LIST[0])
        while(len(q) != 0):
            a = q.popleft()
            MAP[:][a] = ""
            for i in range(N+1):
                if(MAP[a][i]):
                    q.append(i)
                    group.add(i)
                    try:
                        LIST.remove(i)
                    except:
                        pass
                MAP[a][i] = ""
        if(ans < len(group)):
            ans = len(group)
    else:
        break
print(ans)


Fixed submission:
from collections import Counter

class UnionFind:
    def __init__(self,num:int):
        self.r = [-1 for i in range(num)]
    def root(self,x:int):
        if(self.r[x] < 0):
            return x
        self.r[x] = self.root(self.r[x])
        return self.r[x]
    def unite(self,x:int,y:int):
        rx = self.root(x)
        ry = self.root(y)
        if(rx == ry):
            return False
        if(self.r[rx] > self.r[ry]):
            rx,ry = ry,rx
        self.r[rx] += self.r[ry]
        self.r[ry] = rx
        return True
    def size(self,x:int):
        return -self.r[self.root(x)]

N,M = map(int,input().split())
group = UnionFind(N)
for i in range(M):
    A,B = map(int,input().split())
    group.unite(A-1,B-1)
ans = 0
for i in range(N):
    ans = max(ans,group.size(i))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
"""
N = int(input())
A = list(map(int,input().split()))
ans = 0
mod = 1000000007

for i in range(N-1):
    for j in range(i+1,N):
        ans += A[i]*A[j]
        ans = ans%mod
print(ans)
"""
from collections import deque

N,M = map(int,input().split())
MAP = [[False for x in range(N+1)] for x in range(N+1)]
ans = 0
for i in range(M):
    A,B = map(int,input().split())
    MAP[A][B]=True
    MAP[B][A]=True
LIST = list(range(1,N+1))

while(True):
    if(LIST != []):
        group = set()
        group.add(LIST[0])
        q = deque()
        q.append(LIST[0])
        while(len(q) != 0):
            a = q.popleft()
            MAP[:][a] = ""
            for i in range(N+1):
                if(MAP[a][i]):
                    q.append(i)
                    group.add(i)
                    try:
                        LIST.remove(i)
                    except:
                        pass
                MAP[a][i] = ""
        if(ans < len(group)):
            ans = len(group)
    else:
        break
print(ans)


Fixed submission:
from collections import Counter

class UnionFind:
    def __init__(self,num:int):
        self.r = [-1 for i in range(num)]
    def root(self,x:int):
        if(self.r[x] < 0):
            return x
        self.r[x] = self.root(self.r[x])
        return self.r[x]
    def unite(self,x:int,y:int):
        rx = self.root(x)
        ry = self.root(y)
        if(rx == ry):
            return False
        if(self.r[rx] > self.r[ry]):
            rx,ry = ry,rx
        self.r[rx] += self.r[ry]
        self.r[ry] = rx
        return True
    def size(self,x:int):
        return -self.r[self.root(x)]

N,M = map(int,input().split())
group = UnionFind(N)
for i in range(M):
    A,B = map(int,input().split())
    group.unite(A-1,B-1)
ans = 0
for i in range(N):
    ans = max(ans,group.size(i))
print(ans)