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

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

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

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

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

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

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

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

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

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

k.r = j
k.o = l
e.u = m
e.t = m
e.s = l
e.w = l
m.t = j
m.o = h
m.z = h
m.y = k
j.y = d
j.x = l
j.t = e
j.z = m
c.r = j
c.o = e
h.t = j
h.o = m
h.z = m
h.y = k
l.u = m
l.t = m
l.s = e
l.w = d
d.u = m
d.t = m
d.s = e
d.w = e
assert d.t.o.y.o.w.t.t.txt == "j"