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

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

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

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

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

e = A("e")
l = B("l")
h = C("h")
i = D("i")
k = E("k")
d = C("d")
n = B("n")
f = E("f")

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

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

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

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

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

e = A("e")
l = B("l")
h = C("h")
i = D("i")
k = E("k")
d = C("d")
n = B("n")
f = E("f")

e.p = n
e.u = h
e.s = f
l.s = n
l.p = n
l.u = i
h.q = n
i.t = d
i.z = k
i.v = e
k.t = d
k.s = f
k.z = h
k.w = e
d.q = l
n.s = l
n.p = l
n.u = i
f.t = d
f.z = d
f.s = k
f.w = e
assert f.t.q.u.z.w.u.q.u.txt == "i"