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

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

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

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

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

l.r = e
l.s = h
l.w = h
h.o = f
h.w = j
h.q = l
h.z = e
f.v = e
e.t = f
e.x = b
a.o = f
a.w = h
a.q = l
a.z = e
b.r = e
b.s = j
b.w = j
j.o = f
j.w = a
j.q = b
j.z = e
m.r = e
m.s = h
m.w = a
assert h.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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

l.r = e
l.s = h
l.w = h
h.o = f
h.w = j
h.q = l
h.z = e
f.v = e
e.t = f
e.x = b
a.o = f
a.w = h
a.q = l
a.z = e
b.r = e
b.s = j
b.w = j
j.o = f
j.w = a
j.q = b
j.z = e
m.r = e
m.s = h
m.w = a
assert h.w.w.w.txt == "h"