class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: I = None
        self.t: E = None
        self.q: E = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: I = None
        self.t: E = None
        self.q: E = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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