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

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

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

e = A("e")
f = B("f")
i = C("i")
m = C("m")
h = A("h")
d = A("d")

e.y = m
e.o = d
e.x = f
f.s = e
f.u = e
f.v = m
i.v = e
i.r = d
m.v = e
m.r = d
h.y = i
h.o = e
h.x = f
d.y = m
d.o = e
d.x = f
assert i.v.y.v.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: A = None
        self.x: B = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
i = C("i")
m = C("m")
h = A("h")
d = A("d")

e.y = m
e.o = d
e.x = f
f.s = e
f.u = e
f.v = m
i.v = e
i.r = d
m.v = e
m.r = d
h.y = i
h.o = e
h.x = f
d.y = m
d.o = e
d.x = f
assert i.v.y.v.x.u.txt == "e"