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

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

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

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

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

c.r = i
c.x = i
i.v = l
l.t = f
l.r = f
l.o = f
l.z = a
a.w = c
f.t = l
f.r = l
f.o = l
f.z = a
assert c.r.v.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.txt = txt

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

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

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

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

c.r = i
c.x = i
i.v = l
l.t = f
l.r = f
l.o = f
l.z = a
a.w = c
f.t = l
f.r = l
f.o = l
f.z = a
assert c.r.v.r.o.txt == "l"