class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: C = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.q: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: E = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: H = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: B = None
        self.v: D = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

i = A("i")
b = B("b")
a = C("a")
k = D("k")
c = E("c")
e = F("e")
n = G("n")
l = H("l")

i.r = k
i.t = k
b.p = n
b.z = a
b.x = l
a.s = n
a.y = n
a.q = i
a.t = l
k.p = c
k.y = c
k.s = i
c.s = i
c.p = l
c.q = a
e.z = b
e.p = b
e.v = k
e.s = k
n.s = i
l.s = n
assert b.z.q.r.s.t.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: C = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.q: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: E = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: H = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: B = None
        self.v: D = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

i = A("i")
b = B("b")
a = C("a")
k = D("k")
c = E("c")
e = F("e")
n = G("n")
l = H("l")

i.r = k
i.t = k
b.p = n
b.z = a
b.x = l
a.s = n
a.y = n
a.q = i
a.t = l
k.p = c
k.y = c
k.s = i
c.s = i
c.p = l
c.q = a
e.z = b
e.p = b
e.v = k
e.s = k
n.s = i
l.s = n
assert b.z.q.r.s.t.s.t.txt == "k"