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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: F = None
        self.y: I = None
        self.z: C = None
        self.r: C = None
        self.s: C = None
        self.o: G = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: I = None
        self.z: F = None
        self.t: B = None
        self.u: G = None
        self.o: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: G = None
        self.y: F = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: C = None
        self.z: H = None
        self.u: G = None
        self.y: A = None
        self.v: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: F = None
        self.y: I = None
        self.z: C = None
        self.r: C = None
        self.s: C = None
        self.o: G = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: I = None
        self.z: F = None
        self.t: B = None
        self.u: G = None
        self.o: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: G = None
        self.y: F = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: C = None
        self.z: H = None
        self.u: G = None
        self.y: A = None
        self.v: E = None
        self.txt = txt

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

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