class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: D = None
        self.r: C = None
        self.q: G = None
        self.w: B = None
        self.v: C = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: G = None
        self.w: E = None
        self.x: G = None
        self.v: H = None
        self.s: B = None
        self.o: G = None
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.txt = txt

n = A("n")
f = B("f")
m = C("m")
l = D("l")
b = E("b")
k = F("k")
h = G("h")
a = H("a")

n.u = l
n.z = l
n.s = l
n.r = m
n.v = m
n.q = h
n.w = f
f.t = a
f.w = m
m.s = l
l.v = b
l.z = k
b.u = m
k.u = b
k.w = b
k.t = h
k.x = h
k.o = h
k.v = a
k.s = f
k.r = l
h.v = l
a.o = l
a.x = n
assert m.s.v.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: D = None
        self.r: C = None
        self.q: G = None
        self.w: B = None
        self.v: C = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: G = None
        self.w: E = None
        self.x: G = None
        self.v: H = None
        self.s: B = None
        self.o: G = None
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.txt = txt

n = A("n")
f = B("f")
m = C("m")
l = D("l")
b = E("b")
k = F("k")
h = G("h")
a = H("a")

n.u = l
n.z = l
n.s = l
n.r = m
n.v = m
n.q = h
n.w = f
f.t = a
f.w = m
m.s = l
l.v = b
l.z = k
b.u = m
k.u = b
k.w = b
k.t = h
k.x = h
k.o = h
k.v = a
k.s = f
k.r = l
h.v = l
a.o = l
a.x = n
assert m.s.v.u.s.txt == "l"