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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: C = None
        self.q: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: D = None
        self.r: E = None
        self.u: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.u: G = None
        self.z: G = None
        self.w: A = None
        self.t: E = None
        self.s: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: C = None
        self.q: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: D = None
        self.r: E = None
        self.u: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.u: G = None
        self.z: G = None
        self.w: A = None
        self.t: E = None
        self.s: C = None
        self.txt = txt

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

j.z = c
m.q = j
m.x = c
k.z = f
g.q = f
g.t = d
d.z = e
d.r = k
d.x = k
d.q = m
f.p = e
f.u = e
f.z = g
f.r = d
l.y = k
e.r = d
e.o = d
c.y = m
c.o = l
c.u = l
c.z = l
c.w = j
c.t = d
c.s = k
assert m.q.z.t.x.z.z.q.r.z.txt == "e"