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

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

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

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

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

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

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

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

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

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

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

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

l.o = a
l.w = d
l.z = c
l.u = c
m.t = l
f.w = m
j.p = n
j.w = c
j.u = l
j.x = f
j.t = m
a.x = n
a.z = d
a.t = d
c.p = f
c.w = j
c.u = l
c.x = n
c.t = m
n.w = m
d.o = a
d.w = l
d.z = j
d.u = c
assert a.x.w.t.w.u.x.w.t.txt == "l"