class A:
    def __init__(self, txt: str):
        self.o: J = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: E = None
        self.v: H = None
        self.u: F = None
        self.s: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: H = None
        self.s: F = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: G = None
        self.v: D = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: B = None
        self.v: E = None
        self.s: F = None
        self.txt = txt

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

h.o = b
h.u = i
g.w = k
g.o = h
g.v = i
d.y = c
d.v = c
d.q = i
d.u = f
d.s = g
a.x = b
a.t = b
i.v = d
i.w = k
i.o = b
f.z = k
f.y = c
f.x = c
f.s = e
f.q = b
f.p = b
e.o = h
e.p = h
e.u = c
e.s = f
e.v = i
c.w = h
c.t = i
c.q = d
c.z = e
k.p = d
k.o = e
k.v = a
k.x = a
b.u = f
b.s = f
b.q = g
b.v = i
assert f.x.w.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: J = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: E = None
        self.v: H = None
        self.u: F = None
        self.s: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: H = None
        self.s: F = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: G = None
        self.v: D = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: B = None
        self.v: E = None
        self.s: F = None
        self.txt = txt

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

h.o = b
h.u = i
g.w = k
g.o = h
g.v = i
d.y = c
d.v = c
d.q = i
d.u = f
d.s = g
a.x = b
a.t = b
i.v = d
i.w = k
i.o = b
f.z = k
f.y = c
f.x = c
f.s = e
f.q = b
f.p = b
e.o = h
e.p = h
e.u = c
e.s = f
e.v = i
c.w = h
c.t = i
c.q = d
c.z = e
k.p = d
k.o = e
k.v = a
k.x = a
b.u = f
b.s = f
b.q = g
b.v = i
assert f.x.w.u.w.txt == "k"