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

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: J = None
        self.t: H = None
        self.w: E = None
        self.v: H = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: C = None
        self.x: F = None
        self.t: I = None
        self.r: A = None
        self.u: A = None
        self.z: I = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: J = None
        self.x: F = None
        self.v: G = None
        self.r: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: J = None
        self.t: H = None
        self.w: E = None
        self.v: H = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: C = None
        self.x: F = None
        self.t: I = None
        self.r: A = None
        self.u: A = None
        self.z: I = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: J = None
        self.x: F = None
        self.v: G = None
        self.r: D = None
        self.txt = txt

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

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

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