#!/usr/bin/python

from Solution import Solution
obj = Solution()

#A = ["0201","0101","0102","1212","2002"]
#B = "0202"

#A = ["8888"]
#B = "0009"

A = ["8887","8889","8878","8898","8788","8988","7888","9888"]
B = "8888"
print(obj.openLock(A, B))