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

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

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

l = A("l")
n = B("n")
m = C("m")
f = A("f")
e = C("e")
d = B("d")
h = A("h")
b = C("b")

l.o = d
l.v = n
l.y = m
n.r = e
n.v = h
m.t = d
f.o = n
f.v = d
f.y = e
e.t = n
d.r = b
d.v = l
h.o = d
h.v = d
h.y = b
b.t = d
assert e.t.v.o.v.o.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

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

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

l = A("l")
n = B("n")
m = C("m")
f = A("f")
e = C("e")
d = B("d")
h = A("h")
b = C("b")

l.o = d
l.v = n
l.y = m
n.r = e
n.v = h
m.t = d
f.o = n
f.v = d
f.y = e
e.t = n
d.r = b
d.v = l
h.o = d
h.v = d
h.y = b
b.t = d
assert e.t.v.o.v.o.r.t.txt == "d"