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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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