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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: B = None
        self.t: H = None
        self.w: C = None
        self.x: H = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: F = None
        self.v: H = None
        self.p: F = None
        self.w: F = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: C = None
        self.o: G = None
        self.q: F = None
        self.u: H = None
        self.z: B = None
        self.v: H = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: H = None
        self.o: F = None
        self.r: C = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: D = None
        self.v: A = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

h = A("h")
i = B("i")
f = C("f")
m = D("m")
d = E("d")
a = F("a")
b = G("b")
e = H("e")
j = E("j")
k = B("k")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: B = None
        self.t: H = None
        self.w: C = None
        self.x: H = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: F = None
        self.v: H = None
        self.p: F = None
        self.w: F = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: C = None
        self.o: G = None
        self.q: F = None
        self.u: H = None
        self.z: B = None
        self.v: H = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: H = None
        self.o: F = None
        self.r: C = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: D = None
        self.v: A = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

h = A("h")
i = B("i")
f = C("f")
m = D("m")
d = E("d")
a = F("a")
b = G("b")
e = H("e")
j = E("j")
k = B("k")

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