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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.s: A = None
        self.w: E = None
        self.txt = txt

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

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

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

f.s = i
f.y = k
f.u = k
f.v = k
f.z = n
n.s = j
j.t = i
j.w = i
j.q = n
j.s = f
k.s = f
k.p = i
i.z = j
i.t = j
i.y = k
assert n.s.q.s.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: D = None
        self.z: B = None
        self.u: D = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.s: A = None
        self.w: E = None
        self.txt = txt

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

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

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

f.s = i
f.y = k
f.u = k
f.v = k
f.z = n
n.s = j
j.t = i
j.w = i
j.q = n
j.s = f
k.s = f
k.p = i
i.z = j
i.t = j
i.y = k
assert n.s.q.s.t.t.txt == "j"