class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: H = None
        self.t: E = None
        self.x: J = None
        self.o: I = None
        self.r: C = None
        self.q: D = None
        self.z: H = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: C = None
        self.t: I = None
        self.w: E = None
        self.z: B = None
        self.u: F = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: B = None
        self.q: J = None
        self.t: J = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: F = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: C = None
        self.t: I = None
        self.w: E = None
        self.z: B = None
        self.u: F = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: B = None
        self.q: J = None
        self.t: J = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: F = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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