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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.x: I = None
        self.p: F = None
        self.s: A = None
        self.z: A = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: E = None
        self.v: A = None
        self.o: E = None
        self.w: I = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: F = None
        self.z: C = None
        self.q: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: I = None
        self.r: E = None
        self.o: B = None
        self.x: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.x: I = None
        self.p: F = None
        self.s: A = None
        self.z: A = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: E = None
        self.v: A = None
        self.o: E = None
        self.w: I = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: F = None
        self.z: C = None
        self.q: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: I = None
        self.r: E = None
        self.o: B = None
        self.x: H = None
        self.txt = txt

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

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

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

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