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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: B = None
        self.txt = txt

n = A("n")
j = B("j")
l = C("l")
e = D("e")
h = E("h")

n.v = h
n.w = h
n.s = l
n.r = l
n.y = e
j.q = h
j.x = e
l.u = n
l.o = n
e.t = l
e.y = h
e.v = j
e.x = j
e.w = n
h.p = n
h.o = j
assert l.o.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: C = None
        self.w: E = None
        self.y: D = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: B = None
        self.txt = txt

n = A("n")
j = B("j")
l = C("l")
e = D("e")
h = E("h")

n.v = h
n.w = h
n.s = l
n.r = l
n.y = e
j.q = h
j.x = e
l.u = n
l.o = n
e.t = l
e.y = h
e.v = j
e.x = j
e.w = n
h.p = n
h.o = j
assert l.o.y.w.txt == "n"