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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.o: E = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: B = None
        self.y: D = None
        self.q: F = None
        self.x: C = None
        self.r: A = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.o: E = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: B = None
        self.y: D = None
        self.q: F = None
        self.x: C = None
        self.r: A = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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