class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: H = None
        self.v: G = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: D = None
        self.o: C = None
        self.q: F = None
        self.w: C = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: C = None
        self.w: B = None
        self.y: E = None
        self.u: E = None
        self.z: H = None
        self.txt = txt

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

l.t = a
l.s = a
l.v = h
l.o = f
i.x = n
i.o = n
i.w = n
i.z = e
i.q = k
i.y = a
n.q = i
e.z = b
f.p = i
k.o = f
k.w = l
h.u = e
b.t = e
b.p = n
b.w = i
b.y = f
b.u = f
b.z = a
a.t = e
a.p = n
a.w = i
a.y = f
a.u = f
a.z = b
assert b.p.q.o.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: H = None
        self.v: G = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: D = None
        self.o: C = None
        self.q: F = None
        self.w: C = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: C = None
        self.w: B = None
        self.y: E = None
        self.u: E = None
        self.z: H = None
        self.txt = txt

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

l.t = a
l.s = a
l.v = h
l.o = f
i.x = n
i.o = n
i.w = n
i.z = e
i.q = k
i.y = a
n.q = i
e.z = b
f.p = i
k.o = f
k.w = l
h.u = e
b.t = e
b.p = n
b.w = i
b.y = f
b.u = f
b.z = a
a.t = e
a.p = n
a.w = i
a.y = f
a.u = f
a.z = b
assert b.p.q.o.q.z.txt == "e"