class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.x: G = None
        self.u: H = None
        self.z: E = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: I = None
        self.z: F = None
        self.r: F = None
        self.q: F = None
        self.x: H = None
        self.t: A = None
        self.o: A = None
        self.w: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.y: A = None
        self.s: B = None
        self.u: F = None
        self.t: C = None
        self.q: D = None
        self.v: D = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: B = None
        self.x: C = None
        self.u: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: I = None
        self.z: F = None
        self.r: F = None
        self.q: F = None
        self.x: H = None
        self.t: A = None
        self.o: A = None
        self.w: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.y: A = None
        self.s: B = None
        self.u: F = None
        self.t: C = None
        self.q: D = None
        self.v: D = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: B = None
        self.x: C = None
        self.u: H = None
        self.txt = txt

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

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