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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: G = None
        self.o: C = None
        self.x: D = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: B = None
        self.z: A = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: E = None
        self.w: C = None
        self.txt = txt

m = A("m")
i = B("i")
h = C("h")
g = D("g")
k = E("k")
d = F("d")
c = G("c")
n = H("n")
l = F("l")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: G = None
        self.o: C = None
        self.x: D = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: B = None
        self.z: A = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: E = None
        self.w: C = None
        self.txt = txt

m = A("m")
i = B("i")
h = C("h")
g = D("g")
k = E("k")
d = F("d")
c = G("c")
n = H("n")
l = F("l")

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