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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: D = None
        self.q: E = None
        self.o: E = None
        self.r: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.y: A = None
        self.w: E = None
        self.o: E = None
        self.u: E = None
        self.txt = txt

a = A("a")
n = B("n")
e = C("e")
m = D("m")
f = E("f")
i = F("i")
j = G("j")

a.z = e
n.s = i
n.u = i
n.x = j
n.o = j
n.p = a
e.z = j
e.s = m
e.q = f
e.o = f
e.r = i
m.q = i
m.w = e
m.o = n
f.x = n
f.r = j
i.u = n
i.r = n
i.w = n
i.z = e
i.q = f
i.x = j
i.o = a
j.r = m
j.p = n
j.y = a
j.w = f
j.o = f
j.u = f
assert i.o.z.s.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: D = None
        self.q: E = None
        self.o: E = None
        self.r: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.y: A = None
        self.w: E = None
        self.o: E = None
        self.u: E = None
        self.txt = txt

a = A("a")
n = B("n")
e = C("e")
m = D("m")
f = E("f")
i = F("i")
j = G("j")

a.z = e
n.s = i
n.u = i
n.x = j
n.o = j
n.p = a
e.z = j
e.s = m
e.q = f
e.o = f
e.r = i
m.q = i
m.w = e
m.o = n
f.x = n
f.r = j
i.u = n
i.r = n
i.w = n
i.z = e
i.q = f
i.x = j
i.o = a
j.r = m
j.p = n
j.y = a
j.w = f
j.o = f
j.u = f
assert i.o.z.s.q.x.txt == "j"