class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: F = None
        self.y: E = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: G = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: A = None
        self.r: F = None
        self.v: G = None
        self.x: F = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: G = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: A = None
        self.r: F = None
        self.v: G = None
        self.x: F = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

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

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

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

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