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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: E = None
        self.o: D = None
        self.x: B = None
        self.y: D = None
        self.p: F = None
        self.w: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: A = None
        self.r: F = None
        self.t: C = None
        self.s: D = None
        self.z: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: E = None
        self.o: D = None
        self.x: B = None
        self.y: D = None
        self.p: F = None
        self.w: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: A = None
        self.r: F = None
        self.t: C = None
        self.s: D = None
        self.z: D = None
        self.txt = txt

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

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