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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: A = None
        self.txt = txt

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

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

e.o = g
e.p = g
e.z = k
e.v = h
e.y = h
k.z = e
k.w = h
l.w = g
l.v = h
g.x = l
g.z = e
h.p = k
h.v = k
h.y = k
h.x = e
assert l.v.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: D = None
        self.z: B = None
        self.v: E = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: A = None
        self.txt = txt

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

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

e.o = g
e.p = g
e.z = k
e.v = h
e.y = h
k.z = e
k.w = h
l.w = g
l.v = h
g.x = l
g.z = e
h.p = k
h.v = k
h.y = k
h.x = e
assert l.v.p.w.txt == "h"