class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: B = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: E = None
        self.u: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: E = None
        self.u: E = None
        self.txt = txt

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

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

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