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

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

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

l = A("l")
e = B("e")
m = C("m")
b = A("b")
g = B("g")
f = B("f")
k = C("k")
h = C("h")
a = A("a")

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

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

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

l = A("l")
e = B("e")
m = C("m")
b = A("b")
g = B("g")
f = B("f")
k = C("k")
h = C("h")
a = A("a")

l.o = h
l.v = a
e.x = k
e.y = l
e.p = f
m.u = l
m.t = e
b.o = m
b.v = a
g.x = h
g.y = l
g.p = f
f.x = k
f.y = a
f.p = g
k.u = b
k.t = g
h.u = b
h.t = f
a.o = h
a.v = b
assert l.v.o.t.p.y.txt == "l"