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

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

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

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

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

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

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

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

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

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

j.x = c
j.v = i
j.q = l
a.u = j
a.s = j
a.y = c
m.t = a
m.z = e
m.q = i
c.s = a
c.q = l
i.s = a
i.q = a
l.u = j
l.s = j
l.y = c
e.t = l
e.z = m
e.q = c
assert e.z.z.q.q.s.v.s.txt == "a"