class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.y: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

e = A("e")
f = B("f")
c = C("c")
h = D("h")
l = E("l")
g = B("g")

e.w = g
e.v = h
e.y = c
e.z = l
f.o = g
f.y = h
f.r = e
c.w = f
h.z = c
l.v = f
l.x = c
l.u = h
l.q = h
g.o = f
g.y = h
g.r = e
assert l.v.o.r.v.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.y: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

e = A("e")
f = B("f")
c = C("c")
h = D("h")
l = E("l")
g = B("g")

e.w = g
e.v = h
e.y = c
e.z = l
f.o = g
f.y = h
f.r = e
c.w = f
h.z = c
l.v = f
l.x = c
l.u = h
l.q = h
g.o = f
g.y = h
g.r = e
assert l.v.o.r.v.z.w.txt == "f"