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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.u: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.u: D = None
        self.txt = txt

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

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

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