class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: H = None
        self.v: I = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: D = None
        self.x: J = None
        self.v: H = None
        self.p: H = None
        self.o: A = None
        self.y: J = None
        self.u: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: A = None
        self.t: J = None
        self.q: I = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: J = None
        self.z: D = None
        self.y: E = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: I = None
        self.t: A = None
        self.x: A = None
        self.q: J = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: I = None
        self.z: B = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: I = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: D = None
        self.x: J = None
        self.v: H = None
        self.p: H = None
        self.o: A = None
        self.y: J = None
        self.u: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: A = None
        self.t: J = None
        self.q: I = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: J = None
        self.z: D = None
        self.y: E = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: I = None
        self.t: A = None
        self.x: A = None
        self.q: J = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: I = None
        self.z: B = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: I = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

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

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