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

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

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

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

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

c.x = l
a.y = l
i.t = a
e.o = c
e.v = c
e.u = a
e.q = n
l.o = c
l.v = c
l.u = a
l.q = n
n.x = e
assert c.x.q.x.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

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

c.x = l
a.y = l
i.t = a
e.o = c
e.v = c
e.u = a
e.q = n
l.o = c
l.v = c
l.u = a
l.q = n
n.x = e
assert c.x.q.x.v.x.txt == "l"