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

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

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

h = A("h")
a = B("a")
l = C("l")
i = A("i")
b = B("b")
m = A("m")
d = A("d")
c = C("c")
f = B("f")
e = B("e")

h.w = e
h.r = d
h.o = m
a.w = c
a.u = m
a.t = d
l.u = c
l.s = c
l.r = m
i.w = f
i.r = d
i.o = d
b.w = c
b.u = m
b.t = d
m.w = f
m.r = h
m.o = h
d.w = e
d.r = m
d.o = i
c.u = l
c.s = l
c.r = m
f.w = l
f.u = d
f.t = h
e.w = l
e.u = d
e.t = m
assert e.w.u.r.w.u.w.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: A = None
        self.o: A = None
        self.txt = txt

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

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

h = A("h")
a = B("a")
l = C("l")
i = A("i")
b = B("b")
m = A("m")
d = A("d")
c = C("c")
f = B("f")
e = B("e")

h.w = e
h.r = d
h.o = m
a.w = c
a.u = m
a.t = d
l.u = c
l.s = c
l.r = m
i.w = f
i.r = d
i.o = d
b.w = c
b.u = m
b.t = d
m.w = f
m.r = h
m.o = h
d.w = e
d.r = m
d.o = i
c.u = l
c.s = l
c.r = m
f.w = l
f.u = d
f.t = h
e.w = l
e.u = d
e.t = m
assert e.w.u.r.w.u.w.u.o.txt == "i"