class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.p: C = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: H = None
        self.u: C = None
        self.r: B = None
        self.o: I = None
        self.t: A = None
        self.p: A = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: F = None
        self.z: F = None
        self.w: F = None
        self.q: H = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.p: C = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: H = None
        self.u: C = None
        self.r: B = None
        self.o: I = None
        self.t: A = None
        self.p: A = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: F = None
        self.z: F = None
        self.w: F = None
        self.q: H = None
        self.r: E = None
        self.txt = txt

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

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