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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: D = None
        self.w: A = None
        self.x: J = None
        self.r: A = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: D = None
        self.w: A = None
        self.x: J = None
        self.r: A = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: E = None
        self.txt = txt

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

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

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