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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: I = None
        self.w: C = None
        self.t: D = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: E = None
        self.o: J = None
        self.z: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.z: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: H = None
        self.q: D = None
        self.u: H = None
        self.y: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: I = None
        self.w: C = None
        self.t: D = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: E = None
        self.o: J = None
        self.z: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.z: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: H = None
        self.q: D = None
        self.u: H = None
        self.y: D = None
        self.txt = txt

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

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