class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: C = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: G = None
        self.p: B = None
        self.w: G = None
        self.r: H = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: G = None
        self.q: D = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: C = None
        self.w: E = None
        self.u: E = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.z: G = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: G = None
        self.p: B = None
        self.w: G = None
        self.r: H = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: G = None
        self.q: D = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: C = None
        self.w: E = None
        self.u: E = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.z: G = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

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

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