class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: I = None
        self.u: C = None
        self.r: F = None
        self.s: J = None
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: J = None
        self.t: C = None
        self.s: E = None
        self.w: C = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: G = None
        self.w: C = None
        self.s: E = None
        self.p: E = None
        self.r: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: A = None
        self.w: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: J = None
        self.t: C = None
        self.s: E = None
        self.w: C = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: G = None
        self.w: C = None
        self.s: E = None
        self.p: E = None
        self.r: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: A = None
        self.w: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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