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

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

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

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

l = A("l")
i = B("i")
j = C("j")
n = D("n")
b = A("b")
m = C("m")
g = B("g")
d = A("d")
f = B("f")
e = B("e")

l.t = i
l.x = b
l.r = m
l.w = n
i.v = n
i.t = e
j.r = f
j.u = m
j.o = n
n.s = f
n.o = b
b.t = g
b.x = d
b.r = j
b.w = n
m.r = e
m.u = j
m.o = n
g.v = n
g.t = f
d.t = f
d.x = b
d.r = m
d.w = n
f.v = n
f.t = e
e.v = n
e.t = f
assert d.r.o.o.w.o.w.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: A = None
        self.r: C = None
        self.w: D = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
j = C("j")
n = D("n")
b = A("b")
m = C("m")
g = B("g")
d = A("d")
f = B("f")
e = B("e")

l.t = i
l.x = b
l.r = m
l.w = n
i.v = n
i.t = e
j.r = f
j.u = m
j.o = n
n.s = f
n.o = b
b.t = g
b.x = d
b.r = j
b.w = n
m.r = e
m.u = j
m.o = n
g.v = n
g.t = f
d.t = f
d.x = b
d.r = m
d.w = n
f.v = n
f.t = e
e.v = n
e.t = f
assert d.r.o.o.w.o.w.o.r.txt == "j"