class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: H = None
        self.z: A = None
        self.u: G = None
        self.q: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: G = None
        self.w: F = None
        self.z: I = None
        self.q: I = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: H = None
        self.z: A = None
        self.u: G = None
        self.q: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: G = None
        self.w: F = None
        self.z: I = None
        self.q: I = None
        self.v: E = None
        self.txt = txt

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

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

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

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