class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: C = None
        self.v: E = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: H = None
        self.t: F = None
        self.r: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: D = None
        self.w: C = None
        self.y: C = None
        self.v: H = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: H = None
        self.t: F = None
        self.r: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: D = None
        self.w: C = None
        self.y: C = None
        self.v: H = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

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

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