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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: H = None
        self.r: J = None
        self.s: I = None
        self.z: G = None
        self.q: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: H = None
        self.t: B = None
        self.o: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: I = None
        self.r: D = None
        self.z: F = None
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: H = None
        self.r: J = None
        self.s: I = None
        self.z: G = None
        self.q: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: H = None
        self.t: B = None
        self.o: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: I = None
        self.r: D = None
        self.z: F = None
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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