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

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

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

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

a.w = h
a.z = l
a.u = i
e.p = a
e.z = d
e.v = j
d.x = e
i.x = j
l.w = h
l.z = k
l.u = d
j.p = k
j.z = d
j.v = e
k.w = h
k.z = a
k.u = d
h.x = j
assert e.z.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: A = None
        self.u: C = None
        self.txt = txt

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

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

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

a.w = h
a.z = l
a.u = i
e.p = a
e.z = d
e.v = j
d.x = e
i.x = j
l.w = h
l.z = k
l.u = d
j.p = k
j.z = d
j.v = e
k.w = h
k.z = a
k.u = d
h.x = j
assert e.z.x.z.txt == "d"