class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: D = None
        self.z: F = None
        self.v: I = None
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.s: E = None
        self.v: G = None
        self.r: B = None
        self.p: J = None
        self.o: A = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: J = None
        self.s: C = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: I = None
        self.z: I = None
        self.w: C = None
        self.o: C = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.x: D = None
        self.z: E = None
        self.p: E = None
        self.t: A = None
        self.s: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: A = None
        self.o: D = None
        self.y: B = None
        self.v: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: D = None
        self.z: F = None
        self.v: I = None
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.s: E = None
        self.v: G = None
        self.r: B = None
        self.p: J = None
        self.o: A = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: J = None
        self.s: C = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: I = None
        self.z: I = None
        self.w: C = None
        self.o: C = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.x: D = None
        self.z: E = None
        self.p: E = None
        self.t: A = None
        self.s: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: A = None
        self.o: D = None
        self.y: B = None
        self.v: I = None
        self.txt = txt

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

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