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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: G = None
        self.w: F = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: G = None
        self.w: F = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: A = None
        self.txt = txt

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

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

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

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