class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: D = None
        self.o: D = None
        self.txt = txt

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

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

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

l.u = a
h.z = n
h.w = g
h.q = a
n.w = g
n.s = g
n.u = d
n.v = k
g.y = d
g.p = a
g.s = m
g.v = k
g.u = h
g.r = n
g.z = n
k.v = l
k.p = g
k.o = g
a.w = n
c.z = n
c.u = g
c.p = g
c.r = g
c.o = h
d.v = l
d.p = g
d.o = g
m.z = n
m.w = g
m.q = a
assert a.w.w.s.txt == "m"