class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: G = None
        self.u: H = None
        self.w: A = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.z: H = None
        self.y: H = None
        self.p: B = None
        self.x: F = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: B = None
        self.t: H = None
        self.s: A = None
        self.z: A = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.t: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: G = None
        self.u: H = None
        self.w: A = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.z: H = None
        self.y: H = None
        self.p: B = None
        self.x: F = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: B = None
        self.t: H = None
        self.s: A = None
        self.z: A = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.t: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: B = None
        self.txt = txt

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

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