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

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

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

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

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

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

c.w = f
j.w = d
j.z = i
j.y = c
f.o = l
l.u = j
l.q = d
l.v = d
l.t = f
d.w = i
d.x = i
d.z = l
d.u = f
i.w = d
i.x = d
i.z = l
i.u = f
assert c.w.o.t.o.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

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

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

c.w = f
j.w = d
j.z = i
j.y = c
f.o = l
l.u = j
l.q = d
l.v = d
l.t = f
d.w = i
d.x = i
d.z = l
d.u = f
i.w = d
i.x = d
i.z = l
i.u = f
assert c.w.o.t.o.v.u.txt == "f"