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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: H = None
        self.t: D = None
        self.w: J = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: J = None
        self.o: E = None
        self.x: G = None
        self.z: E = None
        self.p: E = None
        self.w: H = None
        self.u: J = None
        self.r: F = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: H = None
        self.t: D = None
        self.w: J = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: J = None
        self.o: E = None
        self.x: G = None
        self.z: E = None
        self.p: E = None
        self.w: H = None
        self.u: J = None
        self.r: F = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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