class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.y: F = None
        self.p: B = None
        self.x: G = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

i = A("i")
a = B("a")
l = C("l")
f = D("f")
k = E("k")
m = F("m")
g = G("g")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

i = A("i")
a = B("a")
l = C("l")
f = D("f")
k = E("k")
m = F("m")
g = G("g")

i.w = k
i.v = k
i.u = a
i.p = a
i.y = m
i.x = g
a.u = l
a.y = f
a.z = i
l.q = i
l.p = i
l.t = i
l.r = i
l.s = a
f.t = l
f.w = i
k.x = f
k.p = a
k.s = a
k.w = l
m.z = g
g.x = l
g.w = l
g.z = f
g.p = a
g.q = m
g.s = k
assert g.p.z.w.s.u.s.txt == "a"