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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: D = None
        self.u: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: J = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: D = None
        self.u: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: J = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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