class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: H = None
        self.s: E = None
        self.x: J = None
        self.q: F = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: H = None
        self.s: B = None
        self.r: F = None
        self.o: D = None
        self.txt = txt

b = A("b")
m = B("m")
a = C("a")
l = D("l")
j = E("j")
k = F("k")
h = G("h")
e = H("e")
n = I("n")
g = J("g")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: H = None
        self.s: E = None
        self.x: J = None
        self.q: F = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: H = None
        self.s: B = None
        self.r: F = None
        self.o: D = None
        self.txt = txt

b = A("b")
m = B("m")
a = C("a")
l = D("l")
j = E("j")
k = F("k")
h = G("h")
e = H("e")
n = I("n")
g = J("g")

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