class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: B = None
        self.o: B = None
        self.v: B = None
        self.u: E = None
        self.x: E = None
        self.txt = txt

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

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

a.z = l
l.t = a
l.s = k
l.p = m
k.p = a
k.r = c
h.u = k
h.x = l
h.o = e
h.z = e
h.q = c
m.t = h
m.u = k
m.x = a
e.o = c
b.p = l
i.z = a
i.q = l
i.o = l
i.v = l
i.u = m
i.x = m
c.s = i
assert b.p.s.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: B = None
        self.o: B = None
        self.v: B = None
        self.u: E = None
        self.x: E = None
        self.txt = txt

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

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

a.z = l
l.t = a
l.s = k
l.p = m
k.p = a
k.r = c
h.u = k
h.x = l
h.o = e
h.z = e
h.q = c
m.t = h
m.u = k
m.x = a
e.o = c
b.p = l
i.z = a
i.q = l
i.o = l
i.v = l
i.u = m
i.x = m
c.s = i
assert b.p.s.p.z.txt == "l"