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

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

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

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

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

f.t = e
f.y = a
e.t = f
e.s = f
e.y = f
e.u = a
a.o = l
a.p = f
a.u = e
a.s = e
l.o = f
l.p = f
l.s = e
l.w = a
assert f.t.u.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: C = None
        self.txt = txt

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

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

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

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

f.t = e
f.y = a
e.t = f
e.s = f
e.y = f
e.u = a
a.o = l
a.p = f
a.u = e
a.s = e
l.o = f
l.p = f
l.s = e
l.w = a
assert f.t.u.o.s.txt == "e"