class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: G = None
        self.u: A = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: C = None
        self.t: F = None
        self.v: G = None
        self.z: F = None
        self.r: C = None
        self.x: A = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: G = None
        self.u: A = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: C = None
        self.t: F = None
        self.v: G = None
        self.z: F = None
        self.r: C = None
        self.x: A = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: B = None
        self.txt = txt

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

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

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

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