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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: J = None
        self.u: I = None
        self.v: I = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: G = None
        self.t: H = None
        self.y: J = None
        self.s: B = None
        self.o: F = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: D = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: E = None
        self.w: H = None
        self.o: J = None
        self.v: H = None
        self.x: A = None
        self.q: B = None
        self.r: A = None
        self.z: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: G = None
        self.z: A = None
        self.v: H = None
        self.w: D = None
        self.q: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: B = None
        self.u: D = None
        self.x: D = None
        self.q: E = None
        self.v: D = None
        self.r: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: J = None
        self.u: I = None
        self.v: I = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: G = None
        self.t: H = None
        self.y: J = None
        self.s: B = None
        self.o: F = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: D = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: E = None
        self.w: H = None
        self.o: J = None
        self.v: H = None
        self.x: A = None
        self.q: B = None
        self.r: A = None
        self.z: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: G = None
        self.z: A = None
        self.v: H = None
        self.w: D = None
        self.q: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: B = None
        self.u: D = None
        self.x: D = None
        self.q: E = None
        self.v: D = None
        self.r: E = None
        self.txt = txt

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

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