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

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

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

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

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

k = A("k")
c = B("c")
m = C("m")
n = D("n")
b = E("b")

k.s = m
k.r = n
c.y = m
c.u = k
m.r = k
m.y = k
m.q = c
m.v = c
m.o = n
n.o = b
n.w = b
b.x = n
b.y = n
b.w = k
b.o = m
assert c.y.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: D = None
        self.txt = txt

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

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

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

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

k = A("k")
c = B("c")
m = C("m")
n = D("n")
b = E("b")

k.s = m
k.r = n
c.y = m
c.u = k
m.r = k
m.y = k
m.q = c
m.v = c
m.o = n
n.o = b
n.w = b
b.x = n
b.y = n
b.w = k
b.o = m
assert c.y.q.u.txt == "k"