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

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

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

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

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

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

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

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

m.v = i
i.x = b
g.u = e
g.x = j
g.o = h
n.u = m
n.x = j
n.o = h
j.u = d
j.x = g
j.o = g
h.u = e
h.x = g
h.o = j
l.v = i
b.v = i
d.v = i
e.v = i
assert i.x.v.x.v.txt == "i"