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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: A = None
        self.x: D = None
        self.y: F = None
        self.v: D = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: H = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: A = None
        self.x: D = None
        self.y: F = None
        self.v: D = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: H = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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