program to print the longest chain of one's from the given binary matrix in java