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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: D = None
        self.y: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: D = None
        self.y: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

h.q = i
h.o = k
h.z = l
h.s = d
j.t = d
j.y = d
j.x = g
j.w = a
a.z = k
a.p = m
g.x = a
g.q = m
l.r = g
l.s = a
l.u = m
m.z = i
m.p = a
k.q = h
k.o = c
k.z = l
k.s = j
c.q = h
c.o = k
c.z = l
c.s = j
d.t = j
d.y = j
d.x = g
d.w = m
i.q = k
i.o = h
i.z = l
i.s = j
assert k.s.w.z.z.s.z.o.q.o.o.txt == "c"