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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.q: C = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: H = None
        self.v: A = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: G = None
        self.w: H = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: H = None
        self.y: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: F = None
        self.o: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.q: C = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: H = None
        self.v: A = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: G = None
        self.w: H = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: H = None
        self.y: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: F = None
        self.o: D = None
        self.txt = txt

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

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