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

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

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

c = A("c")
i = B("i")
l = C("l")
m = A("m")
j = A("j")
k = B("k")

c.u = m
i.z = k
l.t = k
l.x = j
m.u = j
j.u = m
k.z = i
assert l.x.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

c = A("c")
i = B("i")
l = C("l")
m = A("m")
j = A("j")
k = B("k")

c.u = m
i.z = k
l.t = k
l.x = j
m.u = j
j.u = m
k.z = i
assert l.x.u.u.u.u.u.txt == "m"