class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

e = A("e")
c = B("c")
l = C("l")
f = D("f")
i = B("i")
j = A("j")
m = A("m")
d = D("d")
k = C("k")
h = D("h")

e.s = h
c.u = h
l.s = k
l.u = c
f.o = l
f.r = l
f.y = i
i.u = f
j.s = h
m.s = h
d.o = l
d.r = l
d.y = i
k.s = l
k.u = c
h.o = k
h.y = c
h.r = l
assert i.u.r.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

e = A("e")
c = B("c")
l = C("l")
f = D("f")
i = B("i")
j = A("j")
m = A("m")
d = D("d")
k = C("k")
h = D("h")

e.s = h
c.u = h
l.s = k
l.u = c
f.o = l
f.r = l
f.y = i
i.u = f
j.s = h
m.s = h
d.o = l
d.r = l
d.y = i
k.s = l
k.u = c
h.o = k
h.y = c
h.r = l
assert i.u.r.u.u.txt == "h"