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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.u: E = None
        self.y: F = None
        self.p: G = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.t: G = None
        self.q: F = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.s: D = None
        self.x: B = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: B = None
        self.p: G = None
        self.x: C = None
        self.y: E = None
        self.txt = txt

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

k = A("k")
n = B("n")
g = C("g")
c = D("c")
a = E("a")
l = F("l")
e = G("e")

k.x = n
n.w = c
n.q = g
n.s = g
n.u = a
n.y = l
n.p = e
n.v = e
g.v = k
g.z = k
g.t = e
g.q = l
g.s = n
c.y = n
a.z = c
a.v = c
a.s = c
a.x = n
a.w = n
a.y = n
l.o = e
l.p = e
l.v = n
l.x = g
l.y = a
e.r = a
e.s = k
assert g.t.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.u: E = None
        self.y: F = None
        self.p: G = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.t: G = None
        self.q: F = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.s: D = None
        self.x: B = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: B = None
        self.p: G = None
        self.x: C = None
        self.y: E = None
        self.txt = txt

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

k = A("k")
n = B("n")
g = C("g")
c = D("c")
a = E("a")
l = F("l")
e = G("e")

k.x = n
n.w = c
n.q = g
n.s = g
n.u = a
n.y = l
n.p = e
n.v = e
g.v = k
g.z = k
g.t = e
g.q = l
g.s = n
c.y = n
a.z = c
a.v = c
a.s = c
a.x = n
a.w = n
a.y = n
l.o = e
l.p = e
l.v = n
l.x = g
l.y = a
e.r = a
e.s = k
assert g.t.s.x.txt == "n"