class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: J = None
        self.p: E = None
        self.r: G = None
        self.u: I = None
        self.o: H = None
        self.z: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: J = None
        self.p: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: J = None
        self.p: E = None
        self.r: G = None
        self.u: I = None
        self.o: H = None
        self.z: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: J = None
        self.p: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: D = None
        self.txt = txt

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

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