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

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

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

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

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

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

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

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

i.w = d
i.t = e
i.y = c
d.z = e
d.u = i
d.t = c
e.v = d
h.w = c
h.y = c
h.t = e
a.w = d
a.t = e
a.y = c
c.z = e
c.u = a
c.t = d
l.w = c
l.t = e
l.y = d
assert a.w.z.v.t.t.txt == "d"