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

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

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

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

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

l.x = e
e.q = g
c.t = l
c.v = l
c.x = k
c.s = k
j.s = g
j.z = l
i.t = l
i.v = l
i.x = j
i.s = k
k.s = j
k.z = l
a.t = l
a.v = l
a.x = j
a.s = g
g.s = k
g.z = l
assert c.s.s.z.x.q.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

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

l.x = e
e.q = g
c.t = l
c.v = l
c.x = k
c.s = k
j.s = g
j.z = l
i.t = l
i.v = l
i.x = j
i.s = k
k.s = j
k.z = l
a.t = l
a.v = l
a.x = j
a.s = g
g.s = k
g.z = l
assert c.s.s.z.x.q.s.z.txt == "l"