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

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

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

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

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

b = A("b")
n = B("n")
h = C("h")
i = D("i")
l = E("l")
e = B("e")
c = B("c")
a = E("a")

b.r = a
n.w = c
n.v = h
n.o = h
n.z = i
n.p = i
h.o = a
h.q = b
h.y = c
h.x = i
i.x = l
i.s = l
l.p = i
l.v = a
l.o = a
e.w = n
e.v = h
e.o = h
e.z = i
e.p = i
c.w = e
c.v = h
c.o = h
c.z = i
c.p = i
a.p = i
a.v = l
a.o = l
assert a.p.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

b = A("b")
n = B("n")
h = C("h")
i = D("i")
l = E("l")
e = B("e")
c = B("c")
a = E("a")

b.r = a
n.w = c
n.v = h
n.o = h
n.z = i
n.p = i
h.o = a
h.q = b
h.y = c
h.x = i
i.x = l
i.s = l
l.p = i
l.v = a
l.o = a
e.w = n
e.v = h
e.o = h
e.z = i
e.p = i
c.w = e
c.v = h
c.o = h
c.z = i
c.p = i
a.p = i
a.v = l
a.o = l
assert a.p.x.v.txt == "a"