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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

f = A("f")
e = B("e")
i = C("i")
c = D("c")
l = E("l")
d = E("d")
n = A("n")

f.p = l
f.v = n
f.x = n
f.z = c
e.o = i
e.z = i
i.q = l
i.u = c
c.u = d
c.p = n
l.s = d
d.s = l
n.p = d
n.v = f
n.x = f
n.z = c
assert i.q.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.x: A = None
        self.z: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

f = A("f")
e = B("e")
i = C("i")
c = D("c")
l = E("l")
d = E("d")
n = A("n")

f.p = l
f.v = n
f.x = n
f.z = c
e.o = i
e.z = i
i.q = l
i.u = c
c.u = d
c.p = n
l.s = d
d.s = l
n.p = d
n.v = f
n.x = f
n.z = c
assert i.q.s.s.txt == "l"