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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: A = None
        self.r: D = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: C = None
        self.v: B = None
        self.u: D = None
        self.r: F = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: H = None
        self.t: I = None
        self.o: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

m = A("m")
d = B("d")
b = C("b")
k = D("k")
l = E("l")
j = F("j")
e = G("e")
i = H("i")
c = I("c")

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: A = None
        self.r: D = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: C = None
        self.v: B = None
        self.u: D = None
        self.r: F = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: H = None
        self.t: I = None
        self.o: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

m = A("m")
d = B("d")
b = C("b")
k = D("k")
l = E("l")
j = F("j")
e = G("e")
i = H("i")
c = I("c")

m.o = b
d.x = m
d.r = m
d.s = j
d.o = j
d.u = l
d.w = l
d.t = l
d.v = k
d.z = e
b.s = m
b.o = m
b.r = k
b.u = j
k.p = d
k.o = l
k.w = l
k.s = i
k.u = i
k.z = i
k.v = c
k.t = b
k.r = b
l.p = j
l.r = j
l.q = b
l.s = b
l.v = d
l.y = d
l.u = k
j.o = c
e.z = m
e.x = i
e.t = c
e.o = k
i.q = l
i.o = e
i.t = j
c.p = i
assert j.o.p.o.z.txt == "m"