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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: A = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: D = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: C = None
        self.u: F = None
        self.s: G = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

n.s = c
n.y = e
n.p = e
n.u = e
n.x = b
g.t = c
g.u = n
g.r = b
g.w = l
l.w = b
l.r = c
l.z = e
c.x = b
c.u = b
c.v = l
c.s = e
c.z = g
d.o = e
b.z = e
b.w = d
e.y = b
e.u = b
e.v = d
e.w = g
e.x = l
e.t = l
e.p = c
assert g.w.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: G = None
        self.p: G = None
        self.u: G = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: A = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: D = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: C = None
        self.u: F = None
        self.s: G = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

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