class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.s: C = None
        self.t: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: B = None
        self.y: E = None
        self.txt = txt

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

n.p = i
n.v = f
n.s = f
n.t = k
n.u = a
k.v = l
k.y = a
k.t = f
f.t = l
a.o = i
a.p = i
a.v = k
l.u = k
i.s = l
i.y = l
i.z = k
g.s = l
g.y = l
g.z = k
assert n.p.z.v.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.s: C = None
        self.t: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: B = None
        self.y: E = None
        self.txt = txt

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

n.p = i
n.v = f
n.s = f
n.t = k
n.u = a
k.v = l
k.y = a
k.t = f
f.t = l
a.o = i
a.p = i
a.v = k
l.u = k
i.s = l
i.y = l
i.z = k
g.s = l
g.y = l
g.z = k
assert n.p.z.v.u.v.txt == "l"