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

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

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: A = None
        self.s: E = None
        self.v: B = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: H = None
        self.y: C = None
        self.t: E = None
        self.txt = txt

m = A("m")
g = B("g")
j = C("j")
d = D("d")
e = E("e")
i = F("i")
h = G("h")
b = H("b")
a = I("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: A = None
        self.s: E = None
        self.v: B = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: H = None
        self.y: C = None
        self.t: E = None
        self.txt = txt

m = A("m")
g = B("g")
j = C("j")
d = D("d")
e = E("e")
i = F("i")
h = G("h")
b = H("b")
a = I("a")

m.p = b
m.o = i
m.w = i
m.x = i
m.u = h
m.v = d
m.r = e
g.u = i
g.p = d
j.q = m
j.x = m
j.o = g
j.r = e
j.z = d
j.s = a
j.y = a
d.s = a
d.u = e
e.s = h
i.x = h
i.o = h
i.u = d
i.r = j
i.p = j
i.w = a
i.z = a
i.q = m
i.y = g
h.u = d
h.q = m
h.s = e
h.v = g
h.z = g
h.y = j
b.r = a
b.u = h
a.v = g
a.p = b
a.y = j
a.t = e
assert a.p.r.y.z.txt == "d"