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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.t: D = None
        self.u: C = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: E = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.p: E = None
        self.z: F = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.v: B = None
        self.s: E = None
        self.txt = txt

k = A("k")
c = B("c")
h = C("h")
b = D("b")
j = E("j")
n = F("n")
m = G("m")
e = H("e")
d = C("d")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.t: D = None
        self.u: C = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: E = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.p: E = None
        self.z: F = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.v: B = None
        self.s: E = None
        self.txt = txt

k = A("k")
c = B("c")
h = C("h")
b = D("b")
j = E("j")
n = F("n")
m = G("m")
e = H("e")
d = C("d")

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