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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: B = None
        self.t: D = None
        self.o: C = None
        self.s: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: B = None
        self.t: D = None
        self.o: C = None
        self.s: D = None
        self.txt = txt

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

e.y = j
l.s = e
l.w = e
l.p = i
l.r = f
l.t = j
j.w = f
j.p = l
i.x = a
f.u = l
f.v = l
f.t = i
f.o = j
f.s = a
a.x = i
assert f.t.x.x.txt == "i"