class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: C = None
        self.r: F = None
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: A = None
        self.o: B = None
        self.y: D = None
        self.x: C = None
        self.u: C = None
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: F = None
        self.p: D = None
        self.z: B = None
        self.y: C = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

l = A("l")
a = B("a")
k = C("k")
h = D("h")
c = E("c")
d = F("d")
f = G("f")
e = B("e")
m = G("m")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: A = None
        self.o: B = None
        self.y: D = None
        self.x: C = None
        self.u: C = None
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: F = None
        self.p: D = None
        self.z: B = None
        self.y: C = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

l = A("l")
a = B("a")
k = C("k")
h = D("h")
c = E("c")
d = F("d")
f = G("f")
e = B("e")
m = G("m")

l.w = d
l.r = d
l.s = k
l.v = h
a.p = c
a.u = e
a.o = e
a.t = l
k.q = c
k.u = h
h.y = l
h.x = l
h.w = k
h.v = k
h.s = k
h.o = d
h.z = m
c.s = k
c.x = k
c.u = k
c.r = k
c.w = l
c.o = e
c.y = h
d.z = f
d.w = f
f.o = a
f.s = d
f.p = h
f.z = e
f.y = k
f.u = m
f.v = m
e.p = c
e.u = a
e.o = a
e.t = l
m.o = a
m.z = a
m.s = d
m.p = h
m.y = k
m.u = f
m.v = f
assert l.s.q.y.z.txt == "m"