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

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

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

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

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

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

n.p = d
a.v = l
a.o = n
k.r = n
k.t = l
k.x = b
l.w = j
f.r = l
f.u = b
j.r = l
j.u = k
b.r = n
b.t = l
b.x = k
d.r = l
d.u = k
assert b.t.w.u.r.p.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

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

n.p = d
a.v = l
a.o = n
k.r = n
k.t = l
k.x = b
l.w = j
f.r = l
f.u = b
j.r = l
j.u = k
b.r = n
b.t = l
b.x = k
d.r = l
d.u = k
assert b.t.w.u.r.p.r.w.txt == "j"