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

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

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

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

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

a.y = b
l.r = i
c.u = k
c.q = k
c.o = i
c.x = a
b.w = i
e.u = c
e.q = c
e.o = l
e.x = a
k.u = e
k.o = i
k.q = c
k.x = a
i.r = l
assert a.y.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

a.y = b
l.r = i
c.u = k
c.q = k
c.o = i
c.x = a
b.w = i
e.u = c
e.q = c
e.o = l
e.x = a
k.u = e
k.o = i
k.q = c
k.x = a
i.r = l
assert a.y.w.r.txt == "l"