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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: B = None
        self.txt = txt

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

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

i.w = j
i.z = f
i.u = f
c.p = h
c.t = g
j.q = h
j.y = c
j.u = f
f.q = h
f.y = c
f.u = j
e.w = j
e.z = j
e.u = f
g.p = h
g.t = c
h.w = j
h.u = j
h.z = f
assert g.p.w.u.txt == "f"