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

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

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

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

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

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

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

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

f.t = l
f.y = c
f.z = i
i.y = d
i.w = g
l.s = e
l.u = e
d.y = i
d.w = l
c.s = e
c.u = f
h.s = f
h.u = e
e.t = l
e.y = l
e.z = d
g.s = f
g.u = f
assert l.s.y.s.z.w.u.z.txt == "d"