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

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

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

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

e = A("e")
a = B("a")
b = C("b")
c = D("c")
l = D("l")
n = B("n")
f = B("f")
m = C("m")
j = B("j")

e.q = l
e.r = l
e.z = n
a.t = j
a.u = b
b.z = e
b.t = l
c.s = e
c.u = e
c.p = l
c.q = l
l.s = e
l.u = e
l.p = c
l.q = c
n.t = f
n.u = m
f.t = j
f.u = b
m.z = e
m.t = c
j.t = n
j.u = m
assert b.t.q.q.u.r.q.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: B = None
        self.r: D = None
        self.txt = txt

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

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

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

e = A("e")
a = B("a")
b = C("b")
c = D("c")
l = D("l")
n = B("n")
f = B("f")
m = C("m")
j = B("j")

e.q = l
e.r = l
e.z = n
a.t = j
a.u = b
b.z = e
b.t = l
c.s = e
c.u = e
c.p = l
c.q = l
l.s = e
l.u = e
l.p = c
l.q = c
n.t = f
n.u = m
f.t = j
f.u = b
m.z = e
m.t = c
j.t = n
j.u = m
assert b.t.q.q.u.r.q.u.r.u.txt == "e"