code: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  import os
  
  
  
  
  def 	__lowerCamelCase (  )      ->Tuple:
  	snake_case__  					=      os.path.dirname(os.path.realpath(UpperCAmelCase_       )       )
  	snake_case__  					=      os.path.join(UpperCAmelCase_				,							'triangle.txt'       )
  
  	with open(UpperCAmelCase_       ) as f:
  		snake_case__  					=      f.readlines()
  
  	snake_case__  					=      [[int(UpperCAmelCase_       ) for y in x.rstrip('\r\n'       ).split(' '       )] for x in triangle]
  
  	for i in range(1				,							len(UpperCAmelCase_       )       ):
  		for j in range(len(a[i]       )       ):
  			snake_case__  					=      a[i - 1][j] if j != len(a[i - 1]       ) else 0
  			snake_case__  					=      a[i - 1][j - 1] if j > 0 else 0
  			a[i][j] += max(UpperCAmelCase_				,							UpperCAmelCase_       )
  	return max(a[-1]       )
  
  
  if __name__ == "__main__":
  			print(solution())
  
  
  
  
style_context: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  def 	__lowerCamelCase (  UpperCAmelCase_       )      ->int:
  	return 1 if input_a == 0 else 0
  
  
  
  
  def 	__lowerCamelCase (  )      ->None:
  	assert not_gate(0       ) == 1
  	assert not_gate(1       ) == 0
  
  
  if __name__ == "__main__":
  			print(not_gate(0))
  			print(not_gate(1))
  
  
  
  