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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: F = None
        self.s: I = None
        self.o: I = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: I = None
        self.r: H = None
        self.y: J = None
        self.x: E = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: I = None
        self.v: J = None
        self.r: I = None
        self.z: B = None
        self.o: I = None
        self.x: G = None
        self.q: D = None
        self.u: A = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: D = None
        self.y: H = None
        self.v: H = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.x: B = None
        self.s: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: I = None
        self.s: C = None
        self.r: C = None
        self.p: B = None
        self.w: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: F = None
        self.s: I = None
        self.o: I = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: I = None
        self.r: H = None
        self.y: J = None
        self.x: E = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: I = None
        self.v: J = None
        self.r: I = None
        self.z: B = None
        self.o: I = None
        self.x: G = None
        self.q: D = None
        self.u: A = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: D = None
        self.y: H = None
        self.v: H = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.x: B = None
        self.s: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: I = None
        self.s: C = None
        self.r: C = None
        self.p: B = None
        self.w: G = None
        self.txt = txt

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

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