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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: A = None
        self.txt = txt

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

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

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

e.x = k
c.z = e
c.y = e
k.t = n
k.y = i
i.s = e
i.p = h
i.y = a
f.t = k
f.y = i
a.s = e
a.p = c
a.y = i
h.z = e
h.y = e
n.t = k
n.y = a
assert k.t.t.t.t.t.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: A = None
        self.txt = txt

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

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

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

e.x = k
c.z = e
c.y = e
k.t = n
k.y = i
i.s = e
i.p = h
i.y = a
f.t = k
f.y = i
a.s = e
a.p = c
a.y = i
h.z = e
h.y = e
n.t = k
n.y = a
assert k.t.t.t.t.t.y.s.txt == "e"