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

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

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

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

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

f = A("f")
n = B("n")
h = C("h")
c = D("c")
i = E("i")
l = C("l")
e = C("e")
a = E("a")

f.s = e
f.w = n
n.r = a
n.t = a
n.v = e
h.p = l
h.w = c
h.x = e
h.q = e
c.s = a
c.p = a
i.u = c
i.w = c
i.s = c
i.p = f
i.x = n
l.p = h
l.x = h
l.q = h
l.w = c
e.p = h
e.x = h
e.w = c
e.q = l
a.u = c
a.w = c
a.s = c
a.p = f
a.x = n
assert i.p.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

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

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

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

f = A("f")
n = B("n")
h = C("h")
c = D("c")
i = E("i")
l = C("l")
e = C("e")
a = E("a")

f.s = e
f.w = n
n.r = a
n.t = a
n.v = e
h.p = l
h.w = c
h.x = e
h.q = e
c.s = a
c.p = a
i.u = c
i.w = c
i.s = c
i.p = f
i.x = n
l.p = h
l.x = h
l.q = h
l.w = c
e.p = h
e.x = h
e.w = c
e.q = l
a.u = c
a.w = c
a.s = c
a.p = f
a.x = n
assert i.p.w.v.txt == "e"