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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: E = None
        self.v: E = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: D = None
        self.r: A = None
        self.x: C = None
        self.txt = txt

d = A("d")
j = B("j")
b = C("b")
f = D("f")
i = E("i")

d.z = j
d.o = i
d.r = i
d.t = f
j.u = f
j.r = i
j.v = i
j.z = b
b.q = f
b.y = f
f.z = d
f.q = d
i.z = f
i.s = f
i.r = d
i.x = b
assert j.z.y.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: E = None
        self.t: D = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: E = None
        self.v: E = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: D = None
        self.r: A = None
        self.x: C = None
        self.txt = txt

d = A("d")
j = B("j")
b = C("b")
f = D("f")
i = E("i")

d.z = j
d.o = i
d.r = i
d.t = f
j.u = f
j.r = i
j.v = i
j.z = b
b.q = f
b.y = f
f.z = d
f.q = d
i.z = f
i.s = f
i.r = d
i.x = b
assert j.z.y.q.z.txt == "j"