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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: D = None
        self.p: G = None
        self.z: F = None
        self.x: F = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.s: H = None
        self.x: B = None
        self.y: H = None
        self.z: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: G = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: D = None
        self.t: F = None
        self.u: E = None
        self.v: A = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: D = None
        self.p: G = None
        self.z: F = None
        self.x: F = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.s: H = None
        self.x: B = None
        self.y: H = None
        self.z: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: G = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: D = None
        self.t: F = None
        self.u: E = None
        self.v: A = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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