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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

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

c = A("c")
f = B("f")
h = C("h")
e = A("e")
i = A("i")
j = B("j")

c.w = h
c.z = h
f.q = h
f.s = h
f.u = j
h.u = f
e.w = h
e.z = h
i.w = h
i.z = h
j.q = h
j.s = h
j.u = f
assert e.w.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

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

c = A("c")
f = B("f")
h = C("h")
e = A("e")
i = A("i")
j = B("j")

c.w = h
c.z = h
f.q = h
f.s = h
f.u = j
h.u = f
e.w = h
e.z = h
i.w = h
i.z = h
j.q = h
j.s = h
j.u = f
assert e.w.u.s.txt == "h"