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

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

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

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

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

c = A("c")
b = B("b")
i = C("i")
d = D("d")
a = E("a")
l = A("l")
j = C("j")
k = E("k")
h = A("h")

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

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

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

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

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

c = A("c")
b = B("b")
i = C("i")
d = D("d")
a = E("a")
l = A("l")
j = C("j")
k = E("k")
h = A("h")

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