def 						a_		(      lowerCamelCase ):
				UpperCAmelCase__    =							[0] * len(_lowerCamelCase )
				UpperCAmelCase__    =							[]
				UpperCAmelCase__    =							[1] * len(_lowerCamelCase )

				for values in graph.values():
								for i in values:
												indegree[i] += 1

				for i in range(len(_lowerCamelCase ) ):
								if indegree[i] == 0:
												queue.append(_lowerCamelCase )

				while queue:
								UpperCAmelCase__    =							queue.pop(0 )
								for x in graph[vertex]:
												indegree[x] -= 1

												if long_dist[vertex] + 1 > long_dist[x]:
																UpperCAmelCase__    =							long_dist[vertex] + 1

												if indegree[x] == 0:
																queue.append(_lowerCamelCase )

				print(max(_lowerCamelCase ) )


# Adjacency list of Graph
lowerCAmelCase__						:						Tuple		  =			{0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}







longest_distance(graph)




"""simple docstring"""






import socket



def 						a_		(      ):
				UpperCAmelCase__    =							socket.socket(socket.AF_INET      ,    socket.SOCK_STREAM )
				UpperCAmelCase__    =							socket.gethostname()
				UpperCAmelCase__    =							1_2_3_1_2

				sock.connect((host, port) )
				sock.send(b'Hello server!' )

				with open('Received_file'      ,    'wb' ) as out_file:
								print('File opened' )
								print('Receiving data...' )
								while True:
												UpperCAmelCase__    =							sock.recv(1_0_2_4 )
												if not data:
																break
												out_file.write(lowerCamelCase )

				print('Successfully received the file' )
				sock.close()
				print('Connection closed' )


if __name__ == "__main__":
						main()



