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

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

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

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

l = A("l")
i = B("i")
e = C("e")
g = D("g")
j = C("j")
m = D("m")
d = A("d")
k = C("k")
c = B("c")
b = C("b")

l.y = g
l.z = e
l.o = k
l.u = c
i.t = j
i.y = b
e.o = d
g.v = d
j.o = l
m.v = l
d.y = m
d.z = j
d.o = j
d.u = c
k.o = d
c.t = j
c.y = k
b.o = d
assert c.y.o.z.o.y.v.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: C = None
        self.o: C = None
        self.u: B = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
e = C("e")
g = D("g")
j = C("j")
m = D("m")
d = A("d")
k = C("k")
c = B("c")
b = C("b")

l.y = g
l.z = e
l.o = k
l.u = c
i.t = j
i.y = b
e.o = d
g.v = d
j.o = l
m.v = l
d.y = m
d.z = j
d.o = j
d.u = c
k.o = d
c.t = j
c.y = k
b.o = d
assert c.y.o.z.o.y.v.o.o.txt == "l"