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

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

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

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

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

h = A("h")
l = B("l")
a = C("a")
g = D("g")
c = E("c")

h.w = a
h.r = g
h.v = g
h.p = g
h.s = g
l.u = c
l.x = h
a.z = g
a.x = g
a.y = l
g.o = l
g.s = h
g.z = c
c.x = g
c.u = l
c.o = h
assert g.s.w.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.v: D = None
        self.p: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

h = A("h")
l = B("l")
a = C("a")
g = D("g")
c = E("c")

h.w = a
h.r = g
h.v = g
h.p = g
h.s = g
l.u = c
l.x = h
a.z = g
a.x = g
a.y = l
g.o = l
g.s = h
g.z = c
c.x = g
c.u = l
c.o = h
assert g.s.w.y.u.txt == "c"