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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: A = None
        self.u: B = None
        self.p: D = None
        self.w: C = None
        self.txt = txt

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

k.s = n
k.w = i
k.r = b
b.q = n
b.r = f
n.v = c
n.y = k
n.u = i
c.v = k
c.q = i
i.v = k
i.q = k
i.u = b
i.p = c
i.w = n
f.v = c
f.y = k
f.u = i
assert b.q.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: E = None
        self.r: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: A = None
        self.u: B = None
        self.p: D = None
        self.w: C = None
        self.txt = txt

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

k.s = n
k.w = i
k.r = b
b.q = n
b.r = f
n.v = c
n.y = k
n.u = i
c.v = k
c.q = i
i.v = k
i.q = k
i.u = b
i.p = c
i.w = n
f.v = c
f.y = k
f.u = i
assert b.q.v.v.txt == "k"