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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: C = None
        self.v: H = None
        self.w: F = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

m = A("m")
d = B("d")
l = C("l")
a = D("a")
i = E("i")
g = F("g")
b = G("b")
f = H("f")
h = D("h")

m.z = i
m.r = i
d.x = b
d.s = l
d.v = f
d.w = g
d.t = g
d.p = h
l.t = m
l.w = b
l.q = i
l.v = i
a.q = i
a.x = b
a.v = d
i.u = d
g.y = a
b.v = h
b.t = i
b.w = l
b.x = d
b.q = m
b.u = a
f.s = i
f.w = g
h.q = i
h.x = b
h.v = d
assert g.y.x.t.u.x.q.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: C = None
        self.v: H = None
        self.w: F = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

m = A("m")
d = B("d")
l = C("l")
a = D("a")
i = E("i")
g = F("g")
b = G("b")
f = H("f")
h = D("h")

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