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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: E = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: H = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: H = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.u: F = None
        self.v: C = None
        self.x: J = None
        self.o: C = None
        self.z: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: E = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: H = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: H = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.u: F = None
        self.v: C = None
        self.x: J = None
        self.o: C = None
        self.z: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.txt = txt

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

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

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