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

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

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

n = A("n")
j = B("j")
i = C("i")
m = A("m")
l = C("l")
e = C("e")
b = B("b")
f = B("f")
g = C("g")
d = C("d")

n.v = j
n.y = m
j.t = d
j.u = f
j.y = n
i.p = b
m.v = f
m.y = n
l.p = f
e.p = f
b.t = d
b.u = f
b.y = n
f.t = e
f.u = b
f.y = n
g.p = j
d.p = f
assert b.y.y.y.y.y.y.v.y.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: A = None
        self.txt = txt

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

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

n = A("n")
j = B("j")
i = C("i")
m = A("m")
l = C("l")
e = C("e")
b = B("b")
f = B("f")
g = C("g")
d = C("d")

n.v = j
n.y = m
j.t = d
j.u = f
j.y = n
i.p = b
m.v = f
m.y = n
l.p = f
e.p = f
b.t = d
b.u = f
b.y = n
f.t = e
f.u = b
f.y = n
g.p = j
d.p = f
assert b.y.y.y.y.y.y.v.y.v.y.txt == "n"