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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: D = None
        self.y: E = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: C = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

a = A("a")
j = B("j")
b = C("b")
h = D("h")
f = E("f")
k = C("k")
n = C("n")
d = A("d")
m = D("m")
e = C("e")

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: D = None
        self.y: E = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: C = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

a = A("a")
j = B("j")
b = C("b")
h = D("h")
f = E("f")
k = C("k")
n = C("n")
d = A("d")
m = D("m")
e = C("e")

a.p = m
a.z = h
a.o = n
a.s = j
j.z = f
j.y = f
j.o = m
j.s = m
j.r = d
b.u = m
b.q = n
b.v = h
h.t = a
h.r = a
h.q = n
h.w = k
f.v = b
k.u = m
k.v = m
k.q = b
n.u = h
n.q = k
n.v = m
d.p = m
d.z = h
d.o = n
d.s = j
m.t = d
m.r = d
m.q = b
m.w = b
e.u = h
e.v = h
e.q = n
assert e.v.w.q.v.w.q.txt == "b"