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

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

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

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

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

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

i.v = h
i.z = h
i.p = b
i.y = b
i.w = a
b.w = n
b.t = i
b.v = i
b.r = a
n.y = i
n.p = i
n.x = b
h.z = a
a.q = i
a.o = i
a.r = n
a.w = b
assert n.y.w.w.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: B = None
        self.w: E = None
        self.y: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

i.v = h
i.z = h
i.p = b
i.y = b
i.w = a
b.w = n
b.t = i
b.v = i
b.r = a
n.y = i
n.p = i
n.x = b
h.z = a
a.q = i
a.o = i
a.r = n
a.w = b
assert n.y.w.w.w.x.txt == "b"