class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: B = None
        self.y: G = None
        self.x: C = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.s: C = None
        self.x: F = None
        self.txt = txt

l = A("l")
f = B("f")
e = C("e")
j = D("j")
g = E("g")
a = F("a")
k = G("k")
m = E("m")

l.s = a
l.u = f
l.y = k
l.o = k
l.x = e
f.y = a
f.w = j
e.s = k
e.z = l
e.x = a
e.v = f
j.o = f
g.y = l
g.x = e
g.s = m
g.o = m
a.w = k
k.u = a
k.x = a
k.w = l
k.s = e
m.y = l
m.x = e
m.s = g
m.o = g
assert k.w.o.w.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: B = None
        self.y: G = None
        self.x: C = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.s: C = None
        self.x: F = None
        self.txt = txt

l = A("l")
f = B("f")
e = C("e")
j = D("j")
g = E("g")
a = F("a")
k = G("k")
m = E("m")

l.s = a
l.u = f
l.y = k
l.o = k
l.x = e
f.y = a
f.w = j
e.s = k
e.z = l
e.x = a
e.v = f
j.o = f
g.y = l
g.x = e
g.s = m
g.o = m
a.w = k
k.u = a
k.x = a
k.w = l
k.s = e
m.y = l
m.x = e
m.s = g
m.o = g
assert k.w.o.w.o.w.txt == "l"