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

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

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

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

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

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

a.p = e
k.x = j
k.w = e
k.v = e
k.z = a
k.t = b
e.y = a
e.s = n
e.v = k
j.w = k
j.v = b
j.y = e
j.r = a
j.x = a
b.s = a
b.r = e
n.w = k
n.v = b
n.y = e
n.r = l
n.x = l
l.p = e
assert b.r.y.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

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

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

a.p = e
k.x = j
k.w = e
k.v = e
k.z = a
k.t = b
e.y = a
e.s = n
e.v = k
j.w = k
j.v = b
j.y = e
j.r = a
j.x = a
b.s = a
b.r = e
n.w = k
n.v = b
n.y = e
n.r = l
n.x = l
l.p = e
assert b.r.y.p.s.txt == "n"