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

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

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

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

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

l.p = a
l.v = a
l.t = a
e.v = n
e.r = n
e.t = a
a.r = e
n.z = e
n.y = a
i.p = a
i.v = a
i.t = a
assert i.v.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

l.p = a
l.v = a
l.t = a
e.v = n
e.r = n
e.t = a
a.r = e
n.z = e
n.y = a
i.p = a
i.v = a
i.t = a
assert i.v.r.v.txt == "n"