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

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

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

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

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

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

n.y = a
n.x = j
n.t = j
n.s = j
l.r = j
j.x = n
b.y = f
b.w = j
b.r = n
b.p = i
a.o = l
f.y = b
f.w = j
f.r = n
f.p = i
i.o = l
assert a.o.r.x.t.x.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: C = None
        self.t: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

n.y = a
n.x = j
n.t = j
n.s = j
l.r = j
j.x = n
b.y = f
b.w = j
b.r = n
b.p = i
a.o = l
f.y = b
f.w = j
f.r = n
f.p = i
i.o = l
assert a.o.r.x.t.x.t.x.txt == "n"