class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: H = None
        self.t: J = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: F = None
        self.z: C = None
        self.o: E = None
        self.x: C = None
        self.s: I = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: H = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: I = None
        self.t: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: G = None
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: F = None
        self.z: C = None
        self.o: E = None
        self.x: C = None
        self.s: I = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: H = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: I = None
        self.t: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: G = None
        self.v: D = None
        self.txt = txt

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

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