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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: F = None
        self.o: G = None
        self.p: A = None
        self.r: A = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.p: C = None
        self.o: D = None
        self.t: E = None
        self.u: F = None
        self.x: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: F = None
        self.o: G = None
        self.p: A = None
        self.r: A = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.p: C = None
        self.o: D = None
        self.t: E = None
        self.u: F = None
        self.x: C = None
        self.txt = txt

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

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