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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: E = None
        self.t: B = None
        self.y: B = None
        self.txt = txt

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

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

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

j.s = k
j.p = h
k.w = l
m.o = g
m.v = g
m.t = l
m.y = k
i.s = m
i.u = a
g.q = m
g.w = h
g.o = h
g.t = a
g.p = l
a.s = m
a.u = i
h.q = m
h.w = g
h.o = g
h.t = a
h.p = l
l.w = k
assert l.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: E = None
        self.t: B = None
        self.y: B = None
        self.txt = txt

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

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

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

j.s = k
j.p = h
k.w = l
m.o = g
m.v = g
m.t = l
m.y = k
i.s = m
i.u = a
g.q = m
g.w = h
g.o = h
g.t = a
g.p = l
a.s = m
a.u = i
h.q = m
h.w = g
h.o = g
h.t = a
h.p = l
l.w = k
assert l.w.w.w.txt == "k"