class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: G = None
        self.s: H = None
        self.y: C = None
        self.x: C = None
        self.r: J = None
        self.t: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.w: J = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: H = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: I = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.w: J = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: H = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: I = None
        self.t: B = None
        self.txt = txt

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

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

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

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