class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: B = None
        self.v: E = None
        self.p: I = None
        self.w: G = None
        self.t: C = None
        self.u: G = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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