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

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

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

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

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

i.r = m
i.t = d
d.v = a
d.s = i
d.q = l
d.w = c
m.p = c
j.s = a
j.p = l
j.z = l
a.p = c
e.s = a
e.p = j
e.z = l
c.v = m
c.s = i
c.q = j
c.w = d
l.s = a
l.p = j
l.z = j
assert d.v.p.w.s.r.p.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: B = None
        self.txt = txt

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

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

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

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

i.r = m
i.t = d
d.v = a
d.s = i
d.q = l
d.w = c
m.p = c
j.s = a
j.p = l
j.z = l
a.p = c
e.s = a
e.p = j
e.z = l
c.v = m
c.s = i
c.q = j
c.w = d
l.s = a
l.p = j
l.z = j
assert d.v.p.w.s.r.p.s.t.txt == "d"