class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.o: C = None
        self.q: C = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: D = None
        self.y: B = None
        self.z: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: G = None
        self.s: D = None
        self.o: C = None
        self.z: E = None
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: G = None
        self.y: D = None
        self.w: G = None
        self.o: E = None
        self.v: J = None
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: D = None
        self.y: B = None
        self.z: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: G = None
        self.s: D = None
        self.o: C = None
        self.z: E = None
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: G = None
        self.y: D = None
        self.w: G = None
        self.o: E = None
        self.v: J = None
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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