class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: G = None
        self.r: G = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: E = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: H = None
        self.o: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: G = None
        self.r: G = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: E = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: H = None
        self.o: C = None
        self.txt = txt

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

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