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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: I = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: I = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

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

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