class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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