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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: F = None
        self.w: I = None
        self.u: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: I = None
        self.v: G = None
        self.w: H = None
        self.t: I = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.p: E = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: B = None
        self.q: I = None
        self.v: C = None
        self.y: C = None
        self.z: I = None
        self.s: F = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.o: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: F = None
        self.w: I = None
        self.u: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: I = None
        self.v: G = None
        self.w: H = None
        self.t: I = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.p: E = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: B = None
        self.q: I = None
        self.v: C = None
        self.y: C = None
        self.z: I = None
        self.s: F = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.o: G = None
        self.txt = txt

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

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