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

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.s: C = None
        self.txt = txt

e = A("e")
h = B("h")
a = C("a")
k = C("k")
f = B("f")
b = B("b")
l = A("l")
g = C("g")
c = B("c")

e.v = l
e.z = a
h.r = e
h.o = e
h.u = a
a.w = k
a.s = k
a.z = b
k.w = g
k.z = c
k.s = a
f.r = l
f.o = e
f.u = a
b.r = l
b.o = l
b.u = a
l.v = e
l.z = g
g.w = a
g.z = h
g.s = k
c.r = e
c.o = l
c.u = a
assert l.v.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.s: C = None
        self.txt = txt

e = A("e")
h = B("h")
a = C("a")
k = C("k")
f = B("f")
b = B("b")
l = A("l")
g = C("g")
c = B("c")

e.v = l
e.z = a
h.r = e
h.o = e
h.u = a
a.w = k
a.s = k
a.z = b
k.w = g
k.z = c
k.s = a
f.r = l
f.o = e
f.u = a
b.r = l
b.o = l
b.u = a
l.v = e
l.z = g
g.w = a
g.z = h
g.s = k
c.r = e
c.o = l
c.u = a
assert l.v.z.s.txt == "k"