class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.r: I = None
        self.w: D = None
        self.y: I = None
        self.o: B = None
        self.p: B = None
        self.u: D = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: E = None
        self.q: A = None
        self.y: C = None
        self.z: I = None
        self.w: A = None
        self.p: A = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: D = None
        self.p: B = None
        self.x: I = None
        self.t: A = None
        self.u: I = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.r: I = None
        self.w: D = None
        self.y: I = None
        self.o: B = None
        self.p: B = None
        self.u: D = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: E = None
        self.q: A = None
        self.y: C = None
        self.z: I = None
        self.w: A = None
        self.p: A = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: D = None
        self.p: B = None
        self.x: I = None
        self.t: A = None
        self.u: I = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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