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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: B = None
        self.r: D = None
        self.z: F = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

n.p = e
i.v = n
i.t = l
i.x = e
e.p = i
e.x = i
e.r = l
e.v = l
e.z = d
l.p = d
f.s = e
f.o = l
f.v = n
f.y = n
d.p = e
j.s = e
j.o = l
j.v = n
j.y = n
assert f.o.p.p.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: B = None
        self.r: D = None
        self.z: F = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

n.p = e
i.v = n
i.t = l
i.x = e
e.p = i
e.x = i
e.r = l
e.v = l
e.z = d
l.p = d
f.s = e
f.o = l
f.v = n
f.y = n
d.p = e
j.s = e
j.o = l
j.v = n
j.y = n
assert f.o.p.p.x.v.txt == "n"