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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: C = None
        self.r: E = None
        self.t: F = None
        self.w: D = None
        self.x: F = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: C = None
        self.r: E = None
        self.t: F = None
        self.w: D = None
        self.x: F = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

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

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

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