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

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

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

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

e = A("e")
k = B("k")
n = C("n")
i = D("i")
m = C("m")
l = C("l")
h = A("h")

e.u = i
e.x = h
e.o = h
e.t = l
k.o = i
k.u = i
n.t = i
n.q = k
n.w = e
i.t = e
i.v = e
m.t = i
m.q = k
m.w = h
l.t = i
l.q = k
l.w = e
h.u = i
h.x = e
h.o = e
h.t = m
assert m.q.u.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: A = None
        self.t: C = None
        self.o: A = None
        self.txt = txt

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

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

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

e = A("e")
k = B("k")
n = C("n")
i = D("i")
m = C("m")
l = C("l")
h = A("h")

e.u = i
e.x = h
e.o = h
e.t = l
k.o = i
k.u = i
n.t = i
n.q = k
n.w = e
i.t = e
i.v = e
m.t = i
m.q = k
m.w = h
l.t = i
l.q = k
l.w = e
h.u = i
h.x = e
h.o = e
h.t = m
assert m.q.u.t.u.txt == "i"