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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: C = None
        self.txt = txt

f = A("f")
g = B("g")
j = C("j")
i = D("i")
k = E("k")
a = B("a")
e = B("e")
n = A("n")

f.y = n
f.v = k
g.r = e
g.s = k
j.o = a
j.s = i
j.x = i
j.q = i
i.s = n
k.x = j
k.q = j
a.r = e
a.s = k
e.r = a
e.s = k
n.y = f
n.v = k
assert f.y.v.x.s.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: C = None
        self.txt = txt

f = A("f")
g = B("g")
j = C("j")
i = D("i")
k = E("k")
a = B("a")
e = B("e")
n = A("n")

f.y = n
f.v = k
g.r = e
g.s = k
j.o = a
j.s = i
j.x = i
j.q = i
i.s = n
k.x = j
k.q = j
a.r = e
a.s = k
e.r = a
e.s = k
n.y = f
n.v = k
assert f.y.v.x.s.s.v.txt == "k"