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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: E = None
        self.u: B = None
        self.s: A = None
        self.txt = txt

c = A("c")
k = B("k")
i = C("i")
n = D("n")
g = E("g")
m = D("m")
e = E("e")
b = C("b")
l = D("l")

c.r = g
c.u = i
k.r = c
k.w = c
k.p = g
k.z = b
i.q = m
n.o = l
n.p = i
n.s = k
g.r = n
g.o = e
g.u = k
g.s = c
m.o = n
m.p = b
m.s = k
e.r = l
e.o = g
e.u = k
e.s = c
b.q = n
l.o = n
l.p = b
l.s = k
assert m.s.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: E = None
        self.u: B = None
        self.s: A = None
        self.txt = txt

c = A("c")
k = B("k")
i = C("i")
n = D("n")
g = E("g")
m = D("m")
e = E("e")
b = C("b")
l = D("l")

c.r = g
c.u = i
k.r = c
k.w = c
k.p = g
k.z = b
i.q = m
n.o = l
n.p = i
n.s = k
g.r = n
g.o = e
g.u = k
g.s = c
m.o = n
m.p = b
m.s = k
e.r = l
e.o = g
e.u = k
e.s = c
b.q = n
l.o = n
l.p = b
l.s = k
assert m.s.p.u.txt == "k"