class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: C = None
        self.v: C = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: B = None
        self.t: C = None
        self.u: C = None
        self.txt = txt

n = A("n")
i = B("i")
a = C("a")
h = D("h")
d = E("d")

n.q = a
n.u = a
n.v = a
n.t = d
i.r = d
i.p = a
i.w = a
i.y = h
i.s = h
a.y = n
h.o = i
h.w = i
h.q = d
h.y = n
d.v = a
d.t = a
d.u = a
d.p = i
assert a.y.t.v.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: C = None
        self.v: C = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: B = None
        self.t: C = None
        self.u: C = None
        self.txt = txt

n = A("n")
i = B("i")
a = C("a")
h = D("h")
d = E("d")

n.q = a
n.u = a
n.v = a
n.t = d
i.r = d
i.p = a
i.w = a
i.y = h
i.s = h
a.y = n
h.o = i
h.w = i
h.q = d
h.y = n
d.v = a
d.t = a
d.u = a
d.p = i
assert a.y.t.v.y.v.txt == "a"