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

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

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

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

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

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

h.s = i
h.v = j
h.u = j
n.o = j
n.w = e
n.z = e
n.p = h
j.v = e
j.u = n
j.s = i
i.x = e
i.w = n
i.s = j
e.o = i
e.v = j
assert j.u.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: C = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

h.s = i
h.v = j
h.u = j
n.o = j
n.w = e
n.z = e
n.p = h
j.v = e
j.u = n
j.s = i
i.x = e
i.w = n
i.s = j
e.o = i
e.v = j
assert j.u.p.s.txt == "i"