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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: B = None
        self.w: B = None
        self.x: B = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: B = None
        self.w: B = None
        self.x: B = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: E = None
        self.txt = txt

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

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