class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: F = None
        self.y: C = None
        self.v: J = None
        self.z: J = None
        self.t: B = None
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: D = None
        self.u: D = None
        self.w: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: F = None
        self.y: C = None
        self.v: J = None
        self.z: J = None
        self.t: B = None
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: D = None
        self.u: D = None
        self.w: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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