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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: D = None
        self.w: D = None
        self.q: C = None
        self.txt = txt

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

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

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

n.z = f
g.y = f
g.x = f
g.u = n
k.v = f
k.r = f
k.w = f
k.q = i
f.x = k
f.z = h
h.x = n
h.s = n
h.t = n
h.u = f
i.v = f
i.r = f
i.w = f
i.q = k
assert n.z.x.q.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: D = None
        self.w: D = None
        self.q: C = None
        self.txt = txt

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

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

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

n.z = f
g.y = f
g.x = f
g.u = n
k.v = f
k.r = f
k.w = f
k.q = i
f.x = k
f.z = h
h.x = n
h.s = n
h.t = n
h.u = f
i.v = f
i.r = f
i.w = f
i.q = k
assert n.z.x.q.v.x.txt == "k"