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

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

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

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

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

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

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

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

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

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

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

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

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