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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: E = None
        self.t: G = None
        self.r: G = None
        self.o: C = None
        self.v: H = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: E = None
        self.z: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: E = None
        self.t: G = None
        self.r: G = None
        self.o: C = None
        self.v: H = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: E = None
        self.z: H = None
        self.txt = txt

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

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

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