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

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

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

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

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

f = A("f")
l = B("l")
k = C("k")
i = D("i")
h = E("h")

f.x = i
f.u = i
f.w = h
f.t = l
f.v = l
l.x = i
k.y = l
k.u = f
i.v = l
i.p = k
i.y = k
i.w = f
i.s = h
h.x = k
h.u = f
assert k.y.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.w: E = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

f = A("f")
l = B("l")
k = C("k")
i = D("i")
h = E("h")

f.x = i
f.u = i
f.w = h
f.t = l
f.v = l
l.x = i
k.y = l
k.u = f
i.v = l
i.p = k
i.y = k
i.w = f
i.s = h
h.x = k
h.u = f
assert k.y.x.v.txt == "l"