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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: E = None
        self.u: G = None
        self.y: E = None
        self.w: G = None
        self.o: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.o: G = None
        self.s: G = None
        self.w: C = None
        self.z: G = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: E = None
        self.y: D = None
        self.t: E = None
        self.o: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: E = None
        self.u: G = None
        self.y: E = None
        self.w: G = None
        self.o: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.o: G = None
        self.s: G = None
        self.w: C = None
        self.z: G = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: E = None
        self.y: D = None
        self.t: E = None
        self.o: F = None
        self.txt = txt

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

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