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

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

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

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

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

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

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

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

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

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

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

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

c.s = n
c.z = n
c.x = k
c.p = e
e.x = k
n.t = e
n.x = e
n.p = a
n.y = c
j.y = k
k.y = e
k.p = e
k.t = n
k.w = a
k.o = j
a.s = n
a.z = n
a.x = k
a.p = e
assert n.p.s.x.x.t.p.txt == "a"