
import numpy as np


def main():
    n, m = map(int, input().split())
    friends_mat = np.zeros((n, n), dtype=int)
    for i in range(m):
        a, b = map(int, input().split())
        friends_mat[a - 1][b - 1] = 1
        friends_mat[b - 1][a - 1] = 1
    print(friends_mat)
    print(max(friends_mat.sum(axis=0)+1))


if __name__ == "__main__":
    main()

