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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: E = None
        self.s: B = None
        self.r: F = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: A = None
        self.y: F = None
        self.r: G = None
        self.q: G = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.o: E = None
        self.r: A = None
        self.s: C = None
        self.v: C = None
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: E = None
        self.s: B = None
        self.r: F = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: A = None
        self.y: F = None
        self.r: G = None
        self.q: G = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.o: E = None
        self.r: A = None
        self.s: C = None
        self.v: C = None
        self.z: B = None
        self.txt = txt

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

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