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

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

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

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

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

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

h.v = a
h.u = i
h.r = g
g.x = l
g.s = h
g.z = i
n.w = l
n.t = g
n.s = a
n.v = h
c.t = i
a.w = m
l.w = n
l.t = g
l.s = a
l.v = h
m.w = a
i.t = c
assert i.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

h.v = a
h.u = i
h.r = g
g.x = l
g.s = h
g.z = i
n.w = l
n.t = g
n.s = a
n.v = h
c.t = i
a.w = m
l.w = n
l.t = g
l.s = a
l.v = h
m.w = a
i.t = c
assert i.t.t.t.t.txt == "i"