def complete_matrix(X):
    """
    input: X: sparse matrix
    output: Y: same matrix with zeros completed
    """
    Y={}
    row=0
    column=0
    for k in X.keys():
        row=max(row,k[0])
        column=max(column,k[1])
    for i in range(1,row+1):
        for j in range(1,column+1):
            if (i,j) in X.keys():
                Y[i,j]=X[i,j]
            else:
                Y[i,j]=0
    return Y