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

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

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

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

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

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

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

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

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

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

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

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

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