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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: C = None
        self.z: G = None
        self.r: C = None
        self.w: A = None
        self.t: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: C = None
        self.z: G = None
        self.r: C = None
        self.w: A = None
        self.t: B = None
        self.v: C = None
        self.txt = txt

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

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

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