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

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

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

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

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

f = A("f")
d = B("d")
k = C("k")
a = D("a")
g = E("g")
l = D("l")
m = B("m")

f.v = g
f.u = k
d.y = k
d.o = g
k.z = g
k.y = f
a.y = g
a.s = f
a.o = f
a.x = k
g.s = d
g.o = l
l.y = g
l.s = f
l.o = f
l.x = k
m.y = k
m.o = g
assert l.x.z.o.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

f = A("f")
d = B("d")
k = C("k")
a = D("a")
g = E("g")
l = D("l")
m = B("m")

f.v = g
f.u = k
d.y = k
d.o = g
k.z = g
k.y = f
a.y = g
a.s = f
a.o = f
a.x = k
g.s = d
g.o = l
l.y = g
l.s = f
l.o = f
l.x = k
m.y = k
m.o = g
assert l.x.z.o.y.s.txt == "d"