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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.x: F = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: G = None
        self.z: D = None
        self.q: H = None
        self.u: G = None
        self.o: A = None
        self.x: G = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: B = None
        self.y: G = None
        self.x: B = None
        self.w: D = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: B = None
        self.txt = txt

m = A("m")
e = B("e")
n = C("n")
b = D("b")
a = E("a")
l = F("l")
h = G("h")
c = H("c")
d = D("d")
i = G("i")

m.p = a
m.r = n
e.q = a
e.y = a
e.r = d
e.x = l
n.w = m
n.o = m
n.t = i
n.u = i
n.x = i
n.z = b
n.q = c
n.s = l
b.v = a
b.z = e
b.x = e
b.y = h
b.w = d
b.s = l
a.p = m
a.u = e
l.z = a
l.y = d
l.x = e
h.r = n
h.s = e
h.x = e
h.w = e
h.o = e
h.z = a
h.y = m
c.o = i
c.w = e
d.v = a
d.z = e
d.x = e
d.y = h
d.w = b
d.s = l
i.r = n
i.s = e
i.x = e
i.w = e
i.o = e
i.z = a
i.y = m
assert b.x.r.w.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.x: F = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: G = None
        self.z: D = None
        self.q: H = None
        self.u: G = None
        self.o: A = None
        self.x: G = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: B = None
        self.y: G = None
        self.x: B = None
        self.w: D = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: B = None
        self.txt = txt

m = A("m")
e = B("e")
n = C("n")
b = D("b")
a = E("a")
l = F("l")
h = G("h")
c = H("c")
d = D("d")
i = G("i")

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