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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: D = None
        self.w: D = None
        self.z: C = None
        self.y: B = None
        self.s: E = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: E = None
        self.z: D = None
        self.r: H = None
        self.q: H = None
        self.v: D = None
        self.t: I = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: D = None
        self.w: D = None
        self.z: C = None
        self.y: B = None
        self.s: E = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: E = None
        self.z: D = None
        self.r: H = None
        self.q: H = None
        self.v: D = None
        self.t: I = None
        self.o: D = None
        self.txt = txt

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

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