



'''simple docstring'''


class 	UpperCAmelCase	:  # Public class to implement a graph


 '''simple docstring'''




 def __init__(   self							,  lowerCAmelCase_							,  lowerCAmelCase_							,  lowerCAmelCase_) ->      None:



      """simple docstring"""







      a_       		=row
      a_       		=col
      a_       		=graph




 def       lowercase_  (   self							,  lowerCAmelCase_							,  lowerCAmelCase_							,  lowerCAmelCase_) ->      bool:



      """simple docstring"""







      return (
          0 <= i < self.ROW
          and 0 <= j < self.COL
          and not visited[i][j]
          and self.graph[i][j]
      )




 def       lowercase_  (   self							,  lowerCAmelCase_							,  lowerCAmelCase_							,  lowerCAmelCase_) ->      None:



      """simple docstring"""







      a_       		=[-1, -1, -1, 0, 0, 1, 1, 1]  # Coordinate order
      a_       		=[-1, 0, 1, -1, 1, -1, 0, 1]
      a_       		=True  # Make those cells visited
      for k in range(8):
           if self.is_safe(i + row_nbr[k]							,  j + col_nbr[k]							,  lowerCAmelCase_):
                self.diffs(i + row_nbr[k]							,  j + col_nbr[k]							,  lowerCAmelCase_)




 def       lowercase_  (   self) ->      int:  # And finally, count all islands.



      """simple docstring"""







      a_       		=[[False for j in range(self.COL)] for i in range(self.ROW)]
      a_       		=0
      for i in range(self.ROW):
           for j in range(self.COL):
                if visited[i][j] is False and self.graph[i][j] == 1:
                     self.diffs(lowerCAmelCase_							,  lowerCAmelCase_							,  lowerCAmelCase_)
                     count += 1
      return count







'''simple docstring'''


import os
from math import logaa






def  UpperCAmelCase_       (		lowercase__ = "base_exp.txt"       ):


     '''simple docstring'''







     a_       		=0
     a_       		=0
     for i, line in enumerate(open(os.path.join(os.path.dirname(lowercase__       )       ,	lowercase__       )       )       ):
          a_		,						a_       		=list(map(lowercase__       ,	line.split(","       )       )       )
          if x * logaa(lowercase__       ) > largest:
               a_       		=x * logaa(lowercase__       )
               a_       		=i + 1
     return result


if __name__ == "__main__":
  print(solution())


