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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: B = None
        self.p: A = None
        self.o: G = None
        self.x: I = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.x: H = None
        self.r: B = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: F = None
        self.r: B = None
        self.p: C = None
        self.s: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: F = None
        self.o: D = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.w: A = None
        self.u: C = None
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: B = None
        self.p: A = None
        self.o: G = None
        self.x: I = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.x: H = None
        self.r: B = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: F = None
        self.r: B = None
        self.p: C = None
        self.s: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: F = None
        self.o: D = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.w: A = None
        self.u: C = None
        self.q: B = None
        self.txt = txt

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

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