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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: C = None
        self.w: D = None
        self.x: B = None
        self.s: A = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: G = None
        self.r: E = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.x: H = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.r: F = None
        self.s: D = None
        self.u: G = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: C = None
        self.w: D = None
        self.x: B = None
        self.s: A = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: G = None
        self.r: E = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.x: H = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.r: F = None
        self.s: D = None
        self.u: G = None
        self.p: E = None
        self.txt = txt

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

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