class A:
    def __init__(self, txt: str):
        self.x: J = None
        self.p: J = None
        self.s: C = None
        self.t: J = None
        self.o: D = None
        self.w: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: G = None
        self.o: J = None
        self.w: F = None
        self.r: E = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: B = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: A = None
        self.w: F = None
        self.r: B = None
        self.s: E = None
        self.z: G = None
        self.u: G = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: G = None
        self.o: J = None
        self.w: F = None
        self.r: E = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: B = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: A = None
        self.w: F = None
        self.r: B = None
        self.s: E = None
        self.z: G = None
        self.u: G = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

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

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

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