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

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

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

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

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

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

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

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

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

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

k.z = l
l.u = n
a.v = j
e.t = l
e.u = a
e.z = k
e.o = n
j.z = l
n.t = l
n.u = a
n.z = j
n.o = e
assert k.z.u.z.z.txt == "l"