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

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

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

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

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

f = A("f")
a = B("a")
i = C("i")
k = D("k")
c = E("c")
h = A("h")
j = E("j")

f.v = j
f.s = k
f.y = a
f.z = i
f.r = h
a.s = f
i.o = k
k.w = a
k.y = h
c.o = f
c.y = k
c.q = j
c.z = h
h.v = j
h.s = k
h.y = a
h.z = i
h.r = f
j.o = h
j.z = h
j.y = k
j.q = c
assert a.s.y.s.r.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: D = None
        self.y: B = None
        self.z: C = None
        self.r: A = None
        self.txt = txt

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

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

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

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

f = A("f")
a = B("a")
i = C("i")
k = D("k")
c = E("c")
h = A("h")
j = E("j")

f.v = j
f.s = k
f.y = a
f.z = i
f.r = h
a.s = f
i.o = k
k.w = a
k.y = h
c.o = f
c.y = k
c.q = j
c.z = h
h.v = j
h.s = k
h.y = a
h.z = i
h.r = f
j.o = h
j.z = h
j.y = k
j.q = c
assert a.s.y.s.r.z.o.txt == "k"