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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: B = None
        self.z: A = None
        self.txt = txt

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

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