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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: A = None
        self.x: F = None
        self.z: J = None
        self.p: B = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: C = None
        self.o: F = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: H = None
        self.o: C = None
        self.y: H = None
        self.v: H = None
        self.q: H = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: C = None
        self.o: J = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: A = None
        self.x: F = None
        self.z: J = None
        self.p: B = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: C = None
        self.o: F = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: H = None
        self.o: C = None
        self.y: H = None
        self.v: H = None
        self.q: H = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: C = None
        self.o: J = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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