class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.s: G = None
        self.r: D = None
        self.p: D = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: D = None
        self.t: E = None
        self.y: G = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.v: E = None
        self.q: B = None
        self.r: G = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: C = None
        self.u: D = None
        self.t: A = None
        self.r: G = None
        self.txt = txt

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

m = A("m")
l = B("l")
i = C("i")
d = D("d")
a = E("a")
k = F("k")
h = G("h")

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: D = None
        self.t: E = None
        self.y: G = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.v: E = None
        self.q: B = None
        self.r: G = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: C = None
        self.u: D = None
        self.t: A = None
        self.r: G = None
        self.txt = txt

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

m = A("m")
l = B("l")
i = C("i")
d = D("d")
a = E("a")
k = F("k")
h = G("h")

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