class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

f = A("f")
d = B("d")
k = C("k")
m = D("m")
i = E("i")
b = B("b")
e = D("e")

f.v = i
d.v = k
d.x = b
d.s = i
d.u = f
k.y = f
k.r = f
k.v = i
k.s = i
m.w = i
i.u = k
i.o = k
i.t = f
i.s = f
i.y = b
b.v = k
b.x = d
b.s = i
b.u = f
e.w = i
assert d.s.s.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

f = A("f")
d = B("d")
k = C("k")
m = D("m")
i = E("i")
b = B("b")
e = D("e")

f.v = i
d.v = k
d.x = b
d.s = i
d.u = f
k.y = f
k.r = f
k.v = i
k.s = i
m.w = i
i.u = k
i.o = k
i.t = f
i.s = f
i.y = b
b.v = k
b.x = d
b.s = i
b.u = f
e.w = i
assert d.s.s.v.o.txt == "k"