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

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

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

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

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

e = A("e")
c = B("c")
j = C("j")
f = D("f")
l = E("l")
b = D("b")

e.z = c
e.t = c
e.s = c
e.p = l
e.w = j
c.r = l
c.s = b
j.t = e
j.o = e
j.y = b
f.u = l
f.r = e
l.z = j
b.u = l
b.r = e
assert f.r.t.r.z.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: B = None
        self.p: E = None
        self.s: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

e = A("e")
c = B("c")
j = C("j")
f = D("f")
l = E("l")
b = D("b")

e.z = c
e.t = c
e.s = c
e.p = l
e.w = j
c.r = l
c.s = b
j.t = e
j.o = e
j.y = b
f.u = l
f.r = e
l.z = j
b.u = l
b.r = e
assert f.r.t.r.z.o.w.txt == "j"