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

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

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

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

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

l.y = i
l.t = b
l.u = j
j.q = i
d.u = c
c.s = l
b.y = e
b.t = l
b.u = j
a.q = d
k.s = b
i.u = c
e.u = c
m.q = i
assert c.s.u.q.u.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

l.y = i
l.t = b
l.u = j
j.q = i
d.u = c
c.s = l
b.y = e
b.t = l
b.u = j
a.q = d
k.s = b
i.u = c
e.u = c
m.q = i
assert c.s.u.q.u.s.y.txt == "i"