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

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

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

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

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

b = A("b")
n = B("n")
a = C("a")
i = D("i")
c = E("c")

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

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

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

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

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

b = A("b")
n = B("n")
a = C("a")
i = D("i")
c = E("c")

b.p = a
b.z = n
b.r = c
n.z = b
a.u = c
a.z = n
a.x = i
a.y = b
i.p = c
i.y = n
i.s = n
i.t = a
i.w = b
c.s = a
c.w = b
c.o = n
assert c.o.z.p.y.txt == "b"