class A:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: G = None
        self.s: J = None
        self.x: D = None
        self.r: C = None
        self.p: G = None
        self.t: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.t: I = None
        self.z: C = None
        self.v: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.p: E = None
        self.s: C = None
        self.t: D = None
        self.q: E = None
        self.v: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: F = None
        self.z: H = None
        self.s: G = None
        self.p: A = None
        self.w: B = None
        self.x: G = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: G = None
        self.s: J = None
        self.x: D = None
        self.r: C = None
        self.p: G = None
        self.t: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.t: I = None
        self.z: C = None
        self.v: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.p: E = None
        self.s: C = None
        self.t: D = None
        self.q: E = None
        self.v: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: F = None
        self.z: H = None
        self.s: G = None
        self.p: A = None
        self.w: B = None
        self.x: G = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: C = None
        self.txt = txt

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

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