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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.p: F = None
        self.t: C = None
        self.o: B = None
        self.v: B = None
        self.r: G = None
        self.x: F = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.z: H = None
        self.v: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: G = None
        self.z: J = None
        self.w: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: A = None
        self.t: G = None
        self.w: H = None
        self.q: H = None
        self.r: I = None
        self.txt = txt

e = A("e")
g = B("g")
b = C("b")
n = D("n")
c = E("c")
j = F("j")
m = G("m")
h = H("h")
l = I("l")
f = J("f")

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.p: F = None
        self.t: C = None
        self.o: B = None
        self.v: B = None
        self.r: G = None
        self.x: F = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.z: H = None
        self.v: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: G = None
        self.z: J = None
        self.w: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: A = None
        self.t: G = None
        self.w: H = None
        self.q: H = None
        self.r: I = None
        self.txt = txt

e = A("e")
g = B("g")
b = C("b")
n = D("n")
c = E("c")
j = F("j")
m = G("m")
h = H("h")
l = I("l")
f = J("f")

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