class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

f = A("f")
e = B("e")
l = C("l")
c = D("c")
i = B("i")
b = D("b")
a = D("a")

f.r = l
e.s = l
e.w = f
e.r = b
e.o = i
l.u = b
l.x = b
l.o = c
l.w = i
c.s = a
c.t = l
c.u = l
c.r = f
i.s = l
i.w = f
i.r = b
i.o = e
b.s = c
b.t = l
b.u = l
b.r = f
a.s = c
a.t = l
a.u = l
a.r = f
assert e.w.r.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

f = A("f")
e = B("e")
l = C("l")
c = D("c")
i = B("i")
b = D("b")
a = D("a")

f.r = l
e.s = l
e.w = f
e.r = b
e.o = i
l.u = b
l.x = b
l.o = c
l.w = i
c.s = a
c.t = l
c.u = l
c.r = f
i.s = l
i.w = f
i.r = b
i.o = e
b.s = c
b.t = l
b.u = l
b.r = f
a.s = c
a.t = l
a.u = l
a.r = f
assert e.w.r.o.s.txt == "a"