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

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

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

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

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

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

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

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

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

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

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

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

i.w = a
i.u = a
i.o = j
i.z = j
a.r = l
j.p = l
j.z = l
l.p = c
k.u = c
k.s = j
k.p = b
k.w = l
d.p = l
d.z = l
b.p = l
b.z = l
f.u = i
f.s = b
f.p = d
f.w = l
c.w = a
c.u = a
c.o = j
c.z = d
assert k.s.p.p.z.txt == "d"