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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

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

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

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

e.s = m
f.z = d
d.q = f
d.x = e
d.p = a
a.w = f
a.t = m
k.o = i
m.o = i
i.o = k
g.s = m
j.o = m
l.s = i
assert i.o.o.o.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

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

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

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

e.s = m
f.z = d
d.q = f
d.x = e
d.p = a
a.w = f
a.t = m
k.o = i
m.o = i
i.o = k
g.s = m
j.o = m
l.s = i
assert i.o.o.o.o.o.o.o.o.txt == "i"