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

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

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

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

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

i.v = l
i.t = n
i.z = a
i.r = m
l.q = n
l.z = n
l.t = i
l.y = j
a.t = n
a.r = j
n.w = m
n.u = j
d.v = l
d.t = m
d.r = m
d.z = a
m.w = n
m.u = j
e.v = l
e.t = n
e.r = n
e.z = a
j.v = l
j.t = n
j.z = a
j.r = m
assert l.t.v.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: D = None
        self.z: C = None
        self.r: D = None
        self.txt = txt

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

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

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

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

i.v = l
i.t = n
i.z = a
i.r = m
l.q = n
l.z = n
l.t = i
l.y = j
a.t = n
a.r = j
n.w = m
n.u = j
d.v = l
d.t = m
d.r = m
d.z = a
m.w = n
m.u = j
e.v = l
e.t = n
e.r = n
e.z = a
j.v = l
j.t = n
j.z = a
j.r = m
assert l.t.v.t.v.txt == "l"