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

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

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

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

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

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

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

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

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

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

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

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

n.s = c
n.p = c
n.w = k
n.r = k
n.t = a
c.r = n
c.q = n
k.o = a
a.s = e
a.u = c
a.t = k
e.y = a
e.x = n
e.t = k
e.r = c
assert e.x.p.q.s.txt == "c"