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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: E = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
m = C("m")
g = D("g")
b = E("b")
j = E("j")
d = A("d")
c = D("c")
f = E("f")
n = D("n")

l.w = j
l.z = d
i.t = m
i.o = m
m.q = d
m.u = b
g.w = i
g.p = i
b.u = m
b.o = j
j.u = m
j.o = f
d.w = b
d.z = l
c.w = i
c.p = i
f.u = m
f.o = j
n.w = i
n.p = i
assert j.o.o.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: E = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
m = C("m")
g = D("g")
b = E("b")
j = E("j")
d = A("d")
c = D("c")
f = E("f")
n = D("n")

l.w = j
l.z = d
i.t = m
i.o = m
m.q = d
m.u = b
g.w = i
g.p = i
b.u = m
b.o = j
j.u = m
j.o = f
d.w = b
d.z = l
c.w = i
c.p = i
f.u = m
f.o = j
n.w = i
n.p = i
assert j.o.o.u.u.u.txt == "m"