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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.x: E = None
        self.s: I = None
        self.q: H = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: H = None
        self.w: G = None
        self.p: C = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.o: H = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: I = None
        self.u: E = None
        self.w: G = None
        self.y: H = None
        self.p: G = None
        self.x: A = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: B = None
        self.p: J = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: J = None
        self.o: G = None
        self.v: D = None
        self.s: D = None
        self.y: A = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: F = None
        self.t: E = None
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.x: E = None
        self.s: I = None
        self.q: H = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: H = None
        self.w: G = None
        self.p: C = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.o: H = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: I = None
        self.u: E = None
        self.w: G = None
        self.y: H = None
        self.p: G = None
        self.x: A = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: B = None
        self.p: J = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: J = None
        self.o: G = None
        self.v: D = None
        self.s: D = None
        self.y: A = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: F = None
        self.t: E = None
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

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