

import itertools
from pathlib import Path



def  __lowerCAmelCase (  A      ):
	UpperCAmelCase_    			=     [tuple(_UpperCAmelCase      ) for login in logins]

	UpperCAmelCase_    			=     {char for login in split_logins for char in login}

	for permutation in itertools.permutations(_UpperCAmelCase      ):
		UpperCAmelCase_    			=     True
		for login in logins:
			if not (
			    permutation.index(login[0]      )
			    < permutation.index(login[1]      )
			    < permutation.index(login[2]      )
			):
				UpperCAmelCase_    			=     False
				break

		if satisfied:
			return int("".join(_UpperCAmelCase      )      )

	raise Exception("Unable to find the secret passcode"      )



def  __lowerCAmelCase (  A = "keylog.txt"      ):
	UpperCAmelCase_    			=     Path(_UpperCAmelCase      ).parent.joinpath(_UpperCAmelCase      ).read_text().splitlines()

	return find_secret_passcode(_UpperCAmelCase      )


if __name__ == "__main__":
							print(F'{solution() = }')


import unittest

from datasets import load_dataset

from transformers import load_tool

from .test_tools_common import ToolTesterMixin

class   __UpperCamelCase      (   unittest.TestCase       ,       lowercase  ):




	def  __A   (						self		:  str							):


		'''simple docstring'''







		UpperCAmelCase_    			=     load_tool("document-question-answering"							)
		self.tool.setup()
		UpperCAmelCase_    			=     load_tool("document-question-answering"						,		remote=lowerCAmelCase							)




	def  __A   (						self		:  Optional[Any]							):


		'''simple docstring'''







		UpperCAmelCase_    			=     load_dataset("hf-internal-testing/example-documents"						,		split="test"							)
		UpperCAmelCase_    			=     dataset[0]["image"]

		UpperCAmelCase_    			=     self.tool(lowerCAmelCase						,		"When is the coffee break?"							)
		self.assertEqual(lowerCAmelCase						,		"11-14 to 11:39 a.m."							)




	def  __A   (						self		:  Any							):


		'''simple docstring'''







		UpperCAmelCase_    			=     load_dataset("hf-internal-testing/example-documents"						,		split="test"							)
		UpperCAmelCase_    			=     dataset[0]["image"]

		UpperCAmelCase_    			=     self.remote_tool(lowerCAmelCase						,		"When is the coffee break?"							)
		self.assertEqual(lowerCAmelCase						,		"11-14 to 11:39 a.m."							)




	def  __A   (						self		:  int							):


		'''simple docstring'''







		UpperCAmelCase_    			=     load_dataset("hf-internal-testing/example-documents"						,		split="test"							)
		UpperCAmelCase_    			=     dataset[0]["image"]

		self.tool(document=lowerCAmelCase						,		question="When is the coffee break?"							)




	def  __A   (						self		:  Any							):


		'''simple docstring'''







		UpperCAmelCase_    			=     load_dataset("hf-internal-testing/example-documents"						,		split="test"							)
		UpperCAmelCase_    			=     dataset[0]["image"]

		UpperCAmelCase_    			=     self.remote_tool(document=lowerCAmelCase						,		question="When is the coffee break?"							)
		self.assertEqual(lowerCAmelCase						,		"11-14 to 11:39 a.m."							)