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

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

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

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

j = A("j")
n = B("n")
e = C("e")
l = D("l")
b = D("b")

j.z = n
j.r = e
n.t = e
n.z = e
e.u = b
e.o = l
l.z = j
b.z = j
assert e.o.z.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
e = C("e")
l = D("l")
b = D("b")

j.z = n
j.r = e
n.t = e
n.z = e
e.u = b
e.o = l
l.z = j
b.z = j
assert e.o.z.r.o.txt == "l"