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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: I = None
        self.y: I = None
        self.z: H = None
        self.r: J = None
        self.t: E = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: H = None
        self.p: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: I = None
        self.y: I = None
        self.z: H = None
        self.r: J = None
        self.t: E = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: H = None
        self.p: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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