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

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

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

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

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

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

f.s = d
f.o = e
f.v = k
b.z = f
b.p = e
b.q = e
b.y = d
d.o = b
d.p = b
l.r = b
l.x = i
l.o = i
l.v = k
k.t = f
e.z = f
e.p = b
e.q = b
e.y = d
i.r = e
i.x = l
i.o = l
i.v = k
assert l.v.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

f.s = d
f.o = e
f.v = k
b.z = f
b.p = e
b.q = e
b.y = d
d.o = b
d.p = b
l.r = b
l.x = i
l.o = i
l.v = k
k.t = f
e.z = f
e.p = b
e.q = b
e.y = d
i.r = e
i.x = l
i.o = l
i.v = k
assert l.v.t.s.txt == "d"