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

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

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

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

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

h = A("h")
a = B("a")
n = C("n")
f = D("f")
l = E("l")
k = C("k")

h.s = l
h.v = n
a.v = f
a.z = f
a.t = l
a.u = l
a.w = k
n.p = k
n.y = a
f.p = a
l.q = f
l.t = f
k.p = n
k.y = a
assert f.p.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: C = None
        self.txt = txt

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

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

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

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

h = A("h")
a = B("a")
n = C("n")
f = D("f")
l = E("l")
k = C("k")

h.s = l
h.v = n
a.v = f
a.z = f
a.t = l
a.u = l
a.w = k
n.p = k
n.y = a
f.p = a
l.q = f
l.t = f
k.p = n
k.y = a
assert f.p.v.p.txt == "a"