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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: B = None
        self.z: E = None
        self.u: D = None
        self.s: E = None
        self.txt = txt

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

f.r = n
f.v = k
f.w = k
f.y = b
f.u = g
k.y = g
g.p = k
g.y = n
n.s = l
i.s = k
i.v = l
l.r = f
l.v = k
l.z = i
l.s = i
l.u = b
e.r = f
e.v = k
e.z = i
e.s = i
e.u = n
b.s = e
assert n.s.v.y.p.y.p.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.y: D = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: B = None
        self.z: E = None
        self.u: D = None
        self.s: E = None
        self.txt = txt

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

f.r = n
f.v = k
f.w = k
f.y = b
f.u = g
k.y = g
g.p = k
g.y = n
n.s = l
i.s = k
i.v = l
l.r = f
l.v = k
l.z = i
l.s = i
l.u = b
e.r = f
e.v = k
e.z = i
e.s = i
e.u = n
b.s = e
assert n.s.v.y.p.y.p.y.y.txt == "n"