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

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

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

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

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

i.p = l
i.x = e
i.z = m
l.o = i
l.u = c
l.v = a
a.y = e
c.u = e
c.q = l
c.z = l
e.u = c
e.q = l
e.z = l
m.p = l
m.x = e
m.z = i
assert e.u.q.v.y.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

i.p = l
i.x = e
i.z = m
l.o = i
l.u = c
l.v = a
a.y = e
c.u = e
c.q = l
c.z = l
e.u = c
e.q = l
e.z = l
m.p = l
m.x = e
m.z = i
assert e.u.q.v.y.u.q.txt == "l"