class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: B = None
        self.u: E = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: B = None
        self.s: B = None
        self.q: B = None
        self.r: D = None
        self.txt = txt

i = A("i")
k = B("k")
c = C("c")
l = D("l")
j = E("j")
n = B("n")
h = A("h")
m = B("m")

i.y = l
i.w = l
i.s = m
i.u = j
i.v = c
k.y = l
c.w = i
l.v = j
j.w = l
j.r = l
j.o = k
j.s = n
j.q = m
n.y = l
h.y = l
h.w = l
h.s = m
h.u = j
h.v = c
m.y = l
assert l.v.w.v.w.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: B = None
        self.u: E = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: B = None
        self.s: B = None
        self.q: B = None
        self.r: D = None
        self.txt = txt

i = A("i")
k = B("k")
c = C("c")
l = D("l")
j = E("j")
n = B("n")
h = A("h")
m = B("m")

i.y = l
i.w = l
i.s = m
i.u = j
i.v = c
k.y = l
c.w = i
l.v = j
j.w = l
j.r = l
j.o = k
j.s = n
j.q = m
n.y = l
h.y = l
h.w = l
h.s = m
h.u = j
h.v = c
m.y = l
assert l.v.w.v.w.v.q.txt == "m"