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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: F = None
        self.v: C = None
        self.q: E = None
        self.s: C = None
        self.o: A = None
        self.r: E = None
        self.y: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: C = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: C = None
        self.x: D = None
        self.t: D = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: C = None
        self.v: G = None
        self.p: D = None
        self.u: G = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: F = None
        self.v: C = None
        self.q: E = None
        self.s: C = None
        self.o: A = None
        self.r: E = None
        self.y: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: C = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: C = None
        self.x: D = None
        self.t: D = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: C = None
        self.v: G = None
        self.p: D = None
        self.u: G = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

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

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