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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: H = None
        self.x: F = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: B = None
        self.r: E = None
        self.v: B = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: F = None
        self.q: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: H = None
        self.x: F = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: B = None
        self.r: E = None
        self.v: B = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: F = None
        self.q: C = None
        self.txt = txt

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

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