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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: J = None
        self.q: C = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: H = None
        self.p: B = None
        self.v: J = None
        self.r: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: F = None
        self.x: F = None
        self.p: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: J = None
        self.q: C = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: H = None
        self.p: B = None
        self.v: J = None
        self.r: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: F = None
        self.x: F = None
        self.p: C = None
        self.txt = txt

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

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