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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.w: B = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.txt = txt

j = A("j")
e = B("e")
h = C("h")
n = D("n")
i = E("i")
m = D("m")
a = C("a")
d = A("d")
c = E("c")

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.w: B = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.txt = txt

j = A("j")
e = B("e")
h = C("h")
n = D("n")
i = E("i")
m = D("m")
a = C("a")
d = A("d")
c = E("c")

j.q = a
j.u = a
j.z = e
j.r = d
j.v = d
e.t = c
e.v = m
e.s = d
h.x = e
h.w = e
h.o = m
h.p = c
n.v = e
i.r = d
i.u = c
m.v = e
a.x = e
a.w = e
a.o = n
a.p = i
d.q = a
d.u = a
d.z = e
d.r = j
d.v = j
c.r = j
c.u = i
assert e.s.v.q.p.r.r.r.txt == "d"