class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: C = None
        self.t: D = None
        self.x: B = None
        self.s: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.x: E = None
        self.q: A = None
        self.r: B = None
        self.txt = txt

g = A("g")
h = B("h")
e = C("e")
m = D("m")
i = E("i")
c = E("c")
a = E("a")

g.v = m
g.t = m
g.y = e
g.x = h
g.s = h
h.q = m
h.x = m
h.s = e
e.w = c
e.q = a
e.s = m
m.w = c
i.z = g
i.q = g
i.v = e
i.x = a
i.r = h
c.z = g
c.q = g
c.v = e
c.x = i
c.r = h
a.z = g
a.q = g
a.v = e
a.x = c
a.r = h
assert h.s.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: C = None
        self.t: D = None
        self.x: B = None
        self.s: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.x: E = None
        self.q: A = None
        self.r: B = None
        self.txt = txt

g = A("g")
h = B("h")
e = C("e")
m = D("m")
i = E("i")
c = E("c")
a = E("a")

g.v = m
g.t = m
g.y = e
g.x = h
g.s = h
h.q = m
h.x = m
h.s = e
e.w = c
e.q = a
e.s = m
m.w = c
i.z = g
i.q = g
i.v = e
i.x = a
i.r = h
c.z = g
c.q = g
c.v = e
c.x = i
c.r = h
a.z = g
a.q = g
a.v = e
a.x = c
a.r = h
assert h.s.s.w.txt == "c"