class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.s: F = None
        self.z: E = None
        self.w: J = None
        self.q: C = None
        self.y: F = None
        self.o: E = None
        self.x: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: D = None
        self.y: A = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: J = None
        self.q: G = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: G = None
        self.y: H = None
        self.s: A = None
        self.p: F = None
        self.w: A = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: D = None
        self.y: A = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: J = None
        self.q: G = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: G = None
        self.y: H = None
        self.s: A = None
        self.p: F = None
        self.w: A = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

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

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