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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: F = None
        self.x: C = None
        self.txt = txt

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

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

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

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

n = A("n")
i = B("i")
l = C("l")
k = D("k")
a = E("a")
j = F("j")
g = A("g")
e = D("e")

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: F = None
        self.x: C = None
        self.txt = txt

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

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

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

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

n = A("n")
i = B("i")
l = C("l")
k = D("k")
a = E("a")
j = F("j")
g = A("g")
e = D("e")

n.z = l
i.v = j
i.s = j
i.x = l
l.r = k
l.x = i
k.o = e
k.s = n
k.v = j
a.p = i
j.p = a
j.y = g
g.z = l
e.o = k
e.s = g
e.v = j
assert g.z.r.v.p.p.s.y.z.txt == "l"