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

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

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

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

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

l = A("l")
m = B("m")
b = C("b")
n = D("n")
k = E("k")
e = E("e")
i = B("i")

l.p = m
l.s = b
l.x = k
l.v = n
m.x = l
b.s = l
b.w = e
b.z = m
n.t = b
k.t = e
k.y = b
k.x = b
e.t = k
e.y = b
e.x = b
i.x = l
assert m.x.x.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: C = None
        self.x: E = None
        self.v: D = None
        self.txt = txt

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

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

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

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

l = A("l")
m = B("m")
b = C("b")
n = D("n")
k = E("k")
e = E("e")
i = B("i")

l.p = m
l.s = b
l.x = k
l.v = n
m.x = l
b.s = l
b.w = e
b.z = m
n.t = b
k.t = e
k.y = b
k.x = b
e.t = k
e.y = b
e.x = b
i.x = l
assert m.x.x.t.t.t.txt == "e"