class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: G = None
        self.u: J = None
        self.v: D = None
        self.q: E = None
        self.x: G = None
        self.r: F = None
        self.z: H = None
        self.w: H = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: D = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: J = None
        self.x: H = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: J = None
        self.w: C = None
        self.x: F = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: D = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: J = None
        self.x: H = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: J = None
        self.w: C = None
        self.x: F = None
        self.y: A = None
        self.txt = txt

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

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

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