class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

m = A("m")
c = B("c")
d = C("d")
g = D("g")
e = E("e")
f = F("f")
j = G("j")
n = H("n")
l = I("l")

m.s = d
c.p = e
c.u = f
c.o = j
c.s = n
d.p = m
g.v = d
g.z = c
e.u = c
e.p = c
f.q = n
j.r = n
j.p = c
j.w = d
n.v = g
n.p = g
n.u = f
n.x = j
n.o = j
n.q = j
n.y = e
n.z = e
n.w = m
l.s = f
assert n.o.w.p.s.p.s.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

m = A("m")
c = B("c")
d = C("d")
g = D("g")
e = E("e")
f = F("f")
j = G("j")
n = H("n")
l = I("l")

m.s = d
c.p = e
c.u = f
c.o = j
c.s = n
d.p = m
g.v = d
g.z = c
e.u = c
e.p = c
f.q = n
j.r = n
j.p = c
j.w = d
n.v = g
n.p = g
n.u = f
n.x = j
n.o = j
n.q = j
n.y = e
n.z = e
n.w = m
l.s = f
assert n.o.w.p.s.p.s.p.s.p.txt == "m"