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

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

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

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

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

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

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

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

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

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

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

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

e.v = h
e.o = l
l.r = h
n.s = l
n.r = b
n.v = e
h.r = k
h.y = b
h.w = l
h.x = l
k.x = b
k.u = b
k.q = e
b.s = l
b.r = n
b.v = e
assert n.r.r.v.v.txt == "h"