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

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

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

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

i = A("i")
h = B("h")
n = C("n")
f = D("f")
e = C("e")
m = A("m")
l = D("l")
a = B("a")
b = A("b")

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

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

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

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

i = A("i")
h = B("h")
n = C("n")
f = D("f")
e = C("e")
m = A("m")
l = D("l")
a = B("a")
b = A("b")

i.t = f
i.v = f
i.y = h
i.x = e
h.r = a
h.o = m
h.x = n
n.u = h
n.o = h
f.u = l
f.r = m
f.v = a
e.u = h
e.o = h
m.t = l
m.v = f
m.y = a
m.x = n
l.u = f
l.r = i
l.v = h
a.r = h
a.o = b
a.x = e
b.t = f
b.v = f
b.y = a
b.x = n
assert n.o.x.u.o.t.v.r.r.x.txt == "n"