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

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

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

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

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

l.v = g
e.x = a
e.r = n
e.t = j
a.z = n
a.o = e
a.t = l
a.y = f
j.x = g
j.o = f
j.u = n
j.r = e
g.x = j
g.o = l
g.u = n
g.r = e
n.x = a
n.r = e
n.t = j
i.z = n
i.o = n
i.t = l
i.y = f
f.v = g
assert a.t.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

l.v = g
e.x = a
e.r = n
e.t = j
a.z = n
a.o = e
a.t = l
a.y = f
j.x = g
j.o = f
j.u = n
j.r = e
g.x = j
g.o = l
g.u = n
g.r = e
n.x = a
n.r = e
n.t = j
i.z = n
i.o = n
i.t = l
i.y = f
f.v = g
assert a.t.v.o.txt == "l"