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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.u: I = None
        self.v: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: E = None
        self.z: A = None
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: H = None
        self.x: J = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.u: I = None
        self.v: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: E = None
        self.z: A = None
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: H = None
        self.x: J = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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