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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: E = None
        self.txt = txt

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

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

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

e = A("e")
a = B("a")
i = C("i")
k = D("k")
h = E("h")

e.w = h
e.p = h
e.v = i
a.t = i
a.r = h
i.q = h
i.p = k
i.w = k
i.o = a
i.z = e
k.p = e
k.v = a
h.w = a
h.z = i
h.s = i
assert e.w.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: E = None
        self.txt = txt

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

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

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

e = A("e")
a = B("a")
i = C("i")
k = D("k")
h = E("h")

e.w = h
e.p = h
e.v = i
a.t = i
a.r = h
i.q = h
i.p = k
i.w = k
i.o = a
i.z = e
k.p = e
k.v = a
h.w = a
h.z = i
h.s = i
assert e.w.w.t.txt == "i"