class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: F = None
        self.o: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: E = None
        self.x: A = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: E = None
        self.x: A = None
        self.v: C = None
        self.txt = txt

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

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