class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: E = None
        self.r: D = None
        self.x: E = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: A = None
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

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

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

e.v = h
e.z = h
e.x = h
e.u = h
e.r = m
g.u = e
g.w = e
g.s = e
g.t = h
g.x = l
l.s = h
l.q = e
l.y = e
l.u = g
m.w = e
m.z = l
m.u = l
h.w = l
h.t = g
assert g.w.r.w.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: E = None
        self.r: D = None
        self.x: E = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: A = None
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

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

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

e.v = h
e.z = h
e.x = h
e.u = h
e.r = m
g.u = e
g.w = e
g.s = e
g.t = h
g.x = l
l.s = h
l.q = e
l.y = e
l.u = g
m.w = e
m.z = l
m.u = l
h.w = l
h.t = g
assert g.w.r.w.r.w.txt == "e"