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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.x: D = None
        self.t: F = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: E = None
        self.r: A = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: E = None
        self.v: C = None
        self.r: H = None
        self.z: C = None
        self.y: B = None
        self.p: H = None
        self.w: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.x: D = None
        self.t: F = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: E = None
        self.r: A = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: E = None
        self.v: C = None
        self.r: H = None
        self.z: C = None
        self.y: B = None
        self.p: H = None
        self.w: H = None
        self.txt = txt

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

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

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

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