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

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

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

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

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

e.x = n
e.r = k
e.v = i
a.u = k
n.z = h
i.v = k
i.t = e
i.x = h
i.r = n
k.x = n
k.r = e
k.v = i
h.v = k
h.t = k
h.x = i
h.r = n
assert n.z.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

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

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

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

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

e.x = n
e.r = k
e.v = i
a.u = k
n.z = h
i.v = k
i.t = e
i.x = h
i.r = n
k.x = n
k.r = e
k.v = i
h.v = k
h.t = k
h.x = i
h.r = n
assert n.z.x.r.txt == "n"