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

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

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

l = A("l")
c = B("c")
e = C("e")
b = B("b")
m = C("m")
h = C("h")
i = A("i")
n = C("n")

l.y = c
l.o = i
c.o = n
c.s = i
c.v = i
e.u = b
e.x = n
b.o = n
b.s = i
b.v = i
m.u = b
m.x = h
h.u = b
h.x = e
i.y = b
i.o = l
n.u = c
n.x = m
assert i.y.v.y.v.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.txt = txt

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

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

l = A("l")
c = B("c")
e = C("e")
b = B("b")
m = C("m")
h = C("h")
i = A("i")
n = C("n")

l.y = c
l.o = i
c.o = n
c.s = i
c.v = i
e.u = b
e.x = n
b.o = n
b.s = i
b.v = i
m.u = b
m.x = h
h.u = b
h.x = e
i.y = b
i.o = l
n.u = c
n.x = m
assert i.y.v.y.v.y.v.txt == "i"