class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: I = None
        self.r: H = None
        self.o: C = None
        self.x: F = None
        self.y: F = None
        self.q: B = None
        self.s: I = None
        self.z: D = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.z: D = None
        self.y: G = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: A = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.p: B = None
        self.x: H = None
        self.o: A = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: B = None
        self.x: D = None
        self.q: B = None
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: A = None
        self.q: A = None
        self.o: C = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.z: D = None
        self.y: G = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: A = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.p: B = None
        self.x: H = None
        self.o: A = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: B = None
        self.x: D = None
        self.q: B = None
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: A = None
        self.q: A = None
        self.o: C = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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