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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: H = None
        self.p: A = None
        self.v: D = None
        self.r: J = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.r: G = None
        self.o: C = None
        self.w: A = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: C = None
        self.s: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: I = None
        self.u: D = None
        self.r: E = None
        self.x: D = None
        self.p: J = None
        self.w: E = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: C = None
        self.t: H = None
        self.v: H = None
        self.r: J = None
        self.x: F = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: H = None
        self.u: G = None
        self.v: D = None
        self.x: G = None
        self.w: C = None
        self.y: F = None
        self.o: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: H = None
        self.p: A = None
        self.v: D = None
        self.r: J = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.r: G = None
        self.o: C = None
        self.w: A = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: C = None
        self.s: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: I = None
        self.u: D = None
        self.r: E = None
        self.x: D = None
        self.p: J = None
        self.w: E = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: C = None
        self.t: H = None
        self.v: H = None
        self.r: J = None
        self.x: F = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: H = None
        self.u: G = None
        self.v: D = None
        self.x: G = None
        self.w: C = None
        self.y: F = None
        self.o: D = None
        self.txt = txt

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

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