class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

m.o = h
a.p = k
a.v = m
a.z = m
j.s = e
j.p = e
j.z = a
j.y = m
k.p = a
k.s = g
k.t = e
k.u = j
f.w = j
g.w = j
e.s = j
e.p = j
e.z = a
e.y = m
h.p = a
h.s = f
h.t = e
h.u = j
assert g.w.z.p.t.y.o.p.p.txt == "k"