class A:
    def __init__(self, txt: str):
        self.o: J = None
        self.s: B = None
        self.z: H = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: A = None
        self.y: E = None
        self.w: H = None
        self.u: A = None
        self.x: A = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: H = None
        self.r: A = None
        self.o: J = None
        self.v: C = None
        self.u: F = None
        self.q: C = None
        self.x: F = None
        self.y: F = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: H = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: B = None
        self.x: H = None
        self.y: H = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.r: J = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: B = None
        self.q: E = None
        self.p: J = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: A = None
        self.y: E = None
        self.w: H = None
        self.u: A = None
        self.x: A = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: H = None
        self.r: A = None
        self.o: J = None
        self.v: C = None
        self.u: F = None
        self.q: C = None
        self.x: F = None
        self.y: F = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: H = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: B = None
        self.x: H = None
        self.y: H = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.r: J = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: B = None
        self.q: E = None
        self.p: J = None
        self.txt = txt

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

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

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