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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: A = None
        self.q: H = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: I = None
        self.z: G = None
        self.o: E = None
        self.q: B = None
        self.w: D = None
        self.s: H = None
        self.p: B = None
        self.v: J = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: J = None
        self.o: I = None
        self.q: F = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: A = None
        self.w: I = None
        self.v: A = None
        self.o: G = None
        self.t: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: A = None
        self.q: H = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: I = None
        self.z: G = None
        self.o: E = None
        self.q: B = None
        self.w: D = None
        self.s: H = None
        self.p: B = None
        self.v: J = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: J = None
        self.o: I = None
        self.q: F = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: A = None
        self.w: I = None
        self.v: A = None
        self.o: G = None
        self.t: I = None
        self.txt = txt

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

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

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

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