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

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

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

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

l = A("l")
c = B("c")
j = C("j")
a = D("a")
i = B("i")

l.r = j
l.y = j
l.t = c
c.r = j
c.t = j
c.v = j
j.y = c
a.z = j
i.r = j
i.t = j
i.v = j
assert c.r.y.r.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: B = None
        self.y: C = None
        self.txt = txt

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

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

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

l = A("l")
c = B("c")
j = C("j")
a = D("a")
i = B("i")

l.r = j
l.y = j
l.t = c
c.r = j
c.t = j
c.v = j
j.y = c
a.z = j
i.r = j
i.t = j
i.v = j
assert c.r.y.r.y.t.txt == "j"