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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: E = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: E = None
        self.w: C = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: C = None
        self.y: A = None
        self.t: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: E = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: E = None
        self.w: C = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: C = None
        self.y: A = None
        self.t: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: E = None
        self.txt = txt

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

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