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

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

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

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

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

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

j.p = n
j.w = l
j.r = e
m.o = n
m.v = l
m.u = a
m.y = h
k.s = f
k.p = f
k.x = d
l.v = e
l.o = n
l.u = m
l.w = a
h.t = k
h.w = k
h.s = k
h.r = m
e.p = n
e.r = n
e.w = l
n.p = j
n.r = j
n.w = l
a.o = n
a.v = l
a.u = m
a.y = h
f.o = e
f.v = l
f.u = m
f.y = h
d.s = a
d.p = a
d.x = k
assert k.s.u.u.o.p.r.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

j.p = n
j.w = l
j.r = e
m.o = n
m.v = l
m.u = a
m.y = h
k.s = f
k.p = f
k.x = d
l.v = e
l.o = n
l.u = m
l.w = a
h.t = k
h.w = k
h.s = k
h.r = m
e.p = n
e.r = n
e.w = l
n.p = j
n.r = j
n.w = l
a.o = n
a.v = l
a.u = m
a.y = h
f.o = e
f.v = l
f.u = m
f.y = h
d.s = a
d.p = a
d.x = k
assert k.s.u.u.o.p.r.p.w.txt == "l"