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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: D = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: E = None
        self.v: G = None
        self.o: C = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.u: E = None
        self.q: A = None
        self.y: F = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: A = None
        self.txt = txt

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

a = A("a")
f = B("f")
j = C("j")
i = D("i")
h = E("h")
e = F("e")
m = G("m")
b = H("b")
l = I("l")
c = J("c")

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: D = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: E = None
        self.v: G = None
        self.o: C = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.u: E = None
        self.q: A = None
        self.y: F = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: A = None
        self.txt = txt

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

a = A("a")
f = B("f")
j = C("j")
i = D("i")
h = E("h")
e = F("e")
m = G("m")
b = H("b")
l = I("l")
c = J("c")

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