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

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

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

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

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

f = A("f")
i = B("i")
l = C("l")
n = D("n")
e = E("e")
b = D("b")
k = B("k")

f.x = l
i.t = k
i.y = k
i.w = e
l.r = e
l.w = e
l.z = i
l.u = b
n.r = k
e.u = b
e.w = b
b.r = k
k.t = i
k.y = i
k.w = e
assert i.y.w.u.r.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

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

f = A("f")
i = B("i")
l = C("l")
n = D("n")
e = E("e")
b = D("b")
k = B("k")

f.x = l
i.t = k
i.y = k
i.w = e
l.r = e
l.w = e
l.z = i
l.u = b
n.r = k
e.u = b
e.w = b
b.r = k
k.t = i
k.y = i
k.w = e
assert i.y.w.u.r.w.w.txt == "b"