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

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

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

b = A("b")
l = B("l")
a = C("a")
n = B("n")
f = A("f")
j = B("j")
m = C("m")
k = A("k")

b.v = f
b.p = m
b.y = a
l.x = n
l.v = m
l.o = f
a.u = k
n.x = j
n.v = a
n.o = f
f.v = k
f.p = m
f.y = a
j.x = l
j.v = m
j.o = b
m.u = k
k.v = f
k.p = a
k.y = m
assert l.o.p.u.v.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: C = None
        self.y: C = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
a = C("a")
n = B("n")
f = A("f")
j = B("j")
m = C("m")
k = A("k")

b.v = f
b.p = m
b.y = a
l.x = n
l.v = m
l.o = f
a.u = k
n.x = j
n.v = a
n.o = f
f.v = k
f.p = m
f.y = a
j.x = l
j.v = m
j.o = b
m.u = k
k.v = f
k.p = a
k.y = m
assert l.o.p.u.v.p.u.txt == "k"